我正在index.php
url
codeigniter
.htaccess
从.htaccess
移除RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-s
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
我的application/config/config.php
代码:
$config['index_page'] = '';
我的http://localhost/myProject
设置:
home controller
现在当我去:http://localhost/myproject/home
它可以工作..并调用默认的The requested URL /myproject/home/ was not found on this server.
当我去:http://localhost/myproject/index.php/home
它说:
home controller
但是当我去:centos 6.5
它再次起作用并调用默认的windows 8 localhost
我正在使用{{1}},而相同的设置在{{1}}
上完美无缺请帮助,任何建议或帮助将是一个很大的帮助..提前感谢
答案 0 :(得分:2)
我已将/etc/httpd/conf/httpd.conf
编辑为AllowOverride
全部:
<Directory "/var/www/html">
AllowOverride All
</Directory>
现在它按预期工作......:)
答案 1 :(得分:1)
尝试使用此代码:
RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [QSA,L]