.htaccess文件无效

时间:2013-04-22 06:38:05

标签: .htaccess codeigniter

我正在使用CodeIgniter在XAMPP中运行我的应用程序。我有一个.htaccess文件,不再需要我在url中包含index.php但是它不起作用。

我的.htaccess文件的内容是

Options +FollowSymLinks
RewriteEngine on
RewriteCond $1 !^(index\.php|crossdomain\.xml|captcha|images|assets|archive|css|js|uploads|robots\.txt)
RewriteRule ^(.*)$ /index.php?/$1 [L]

我已经将AllowOverride的所有目录设置为All。我已经启用了mod_rewrite但仍然无法使用我的链接。它将转到XAMPP主页,而不是转到指定的URL。

同样在我的配置文件中,它看起来像这样:

  

$ config ['base_url'] ='';
  $ config ['index_page'] ='';

然后在视图中:

  

a href =“/ signup”

我做得对吗?请帮忙。

1 个答案:

答案 0 :(得分:0)

尝试

Options +FollowSymlinks
# Options +SymLinksIfOwnerMatch
RewriteEngine On
# RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteCond $1 !^(index\.php|monitor\.php|resources|test_gui|img|css|js|favicon\.ico|(.*)\.(png|js|jpg|swf|css|gif|ico|jpeg|scss)$)
RewriteRule ^(.*)$ index.php/$1 [L]
相关问题