【发布时间】:2012-04-29 20:12:39
【问题描述】:
我在我的网站上使用这个 htaccess 文件来删除 index.php。
RewriteEngine on
RewriteCond $1 !^(index\.php)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
但是这个文件不起作用。在 Apache 模块中启用了重写。使用的 codeigniter 版本是 2.0.1。
【问题讨论】:
-
尝试删除第一个
RewriteCond并将RewriteRule模式更改为^(?!index\.php.*)$ -
你要我这样做吗? RewriteRule 上的 RewriteEngine ^(.*)$ ^(?!index\.php.*)$
-
不,
RewriteRule ^(?!index\.php.*)$ index.php/$1 [L,QSA]。并删除RewriteCond $1 !^(index\.php)。
标签: php .htaccess codeigniter