codeigniter problem - site redirects to localhost after migrating
i just copied the CI files from server to my loca开发者_如何学Pythonlhost and I am having problem running the site.
Whenever i click the site link in WAMP http://localhost/CmpOnline/
it shows me the same folderlist as on localhost
this is my htaccess file
RewriteEngine on
RewriteCond $1 !^(index\.php|images|javascript|stylesheets|uploads|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
and in the config file
$config['base_url'] = "http://localhost/CmpOnline/";
$config['index_page'] = "";
$config['uri_protocol'] = "REQUEST_URI";
I changes this to all the other available options but it still does not work
I tried this .htaccess and codeigniter not working and this Remove index.php From URL - Codeigniter 2
But it still does not work.
Any help?
You should have a RewriteBase
:
RewriteEngine on
RewriteBase /CmpOnline
RewriteCond $1 !^(index\.php|images|javascript|stylesheets|uploads|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
since the RewriteRule
is sending everything to the root of RewriteBase
, which defaults to /
(CodeIgniter will still need the base_url
setting, for its internal stuff).
if
$config['uri_protocol'] = "REQUEST_URI";
change it to
$config['uri_protocol'] = 'PATH_INFO';
if use this
$config['uri_protocol'] = 'ORIG_PATH_INFO';
with redirect or header location to url not in htaccess will not work you must add the url in htaccess to work
Options +FollowSymLinks
RewriteEngine on
# Send request via index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
精彩评论