【发布时间】:2014-05-27 09:28:07
【问题描述】:
这是 .htaccess 但不起作用
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
#Removes index.php from ExpressionEngine URLs
RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
RewriteCond %{REQUEST_URI} !/configSite/.* [NC]
RewriteRule (.*?)index\.php/*(.*) /$1$2 [R=301,NE,L]
RewriteEngine On
RewriteCond $1 !^(index.php|public|robots.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
</IfModule>
配置文件:
$config['uri_protocol'] = 'REQUEST_URI';
$config['index_page'] = '';
我想访问http://serv.er/controller/ 而不是http://serv.er/index.php/controller/
它是怎么做的?
谢谢
【问题讨论】:
-
one.Com 不支持 RewriteBase
-
我和他们交谈,他们说他们支持并且在 localhost 中不起作用
-
检查 mod_rewrite 是否启用
-
在服务器和本地启用
-
@Esloop 奇怪我的解决方案应该可以工作
标签: php .htaccess codeigniter