Welcome Guest, Not a member yet? Register   Sign In
why all request use Controller Welcome?
#1

[eluser]Unknown[/eluser]
I have upload my website to linux server, it is use cpanel
i have use follow:

RewriteEngine on
RewriteBase /
RewriteCond $1 !^(index\.php|images/|css/|robots\.txt|js/)
RewriteRule ^(.*)$ index.php?$1 [L]

and

$config['index_page'] = "";

but when i request a url such as : /aaa/bbb
it also use welcome Controller, no use Controller aaa
but if I request /index.php/aaa/bbb
it is right

and it is right at my computer(windows with apache)

why?
#2

[eluser]WanWizard[/eluser]
Your rewrite rule removes all URI segments by moving them after the question mark (where they are useless). So every request is rewritten to request index.php without segments, which loads the default controller.

Change the question mark into a slash, and you'll be fine.
#3

[eluser]pbreit[/eluser]
Here's mod_rewrite code from CodeIgniter documentation:
Code:
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]




Theme © iAndrew 2016 - Forum software by © MyBB