2011-05-23 177 views
0

我刚刚将配置项文件从服务器复制到我的本地主机,并遇到运行该网站的问题。codeigniter问题 - 迁移后网站重定向到本地主机

每当我点击WAMP http://localhost/CmpOnline/

该网站的链接它显示了我同样的folderlist为localhost上

这是我的htaccess文件

RewriteEngine on 
RewriteCond $1 !^(index\.php|images|javascript|stylesheets|uploads|robots\.txt) 
RewriteRule ^(.*)$ /index.php/$1 [L] 

,并在配置文件中

$config['base_url'] = "http://localhost/CmpOnline/"; 

$config['index_page'] = ""; 

$config['uri_protocol'] = "REQUEST_URI"; 

我改变了这个所有其他可用的选项,但它仍然无法正常工作

我想这 .htaccess and codeigniter not workingRemove index.php From URL - Codeigniter 2

但它仍然无法正常工作。

任何帮助?

+0

清除缓存我试过太多,但它不工作,不知道为什么。 – Ivan 2011-05-23 13:23:49

回答

1

你应该有一个RewriteBase

RewriteEngine on 
RewriteBase /CmpOnline 
RewriteCond $1 !^(index\.php|images|javascript|stylesheets|uploads|robots\.txt) 
RewriteRule ^(.*)$ /index.php/$1 [L] 

因为RewriteRule派遣一切的RewriteBase根,默认为/(笨仍然需要base_url设置,其内部的东西)。

+0

Options +FollowSymLinks RewriteEngine on # Send request via index.php RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L] 

wannabeprogrammer 2011-05-23 10:16:29

1

如果

$config['uri_protocol'] = "REQUEST_URI"; 

改变它

$config['uri_protocol'] = 'PATH_INFO'; 

如果使用这种

$config['uri_protocol'] = 'ORIG_PATH_INFO'; 

与重定向或头部位置的URL不htaccess的不工作,你必须添加网址在htaccess工作

0
在浏览器
+1

请在你的回答中添加一些解释。 – 2013-06-06 19:58:35

相关问题