apache取掉index.php后无法正常工作
本帖最后由 winsonnxl 于 2010-10-11 11:50 编辑我按论坛上前辈的设置,配置好了。
并且执行http://localhost:85/kanwoa/后与http://localhost:85/kanwoa/index.php显示的内容一样了。
但在执行其他的方法的时候,就显示404错误,必须要加上index.php才行。
比如执行http://localhost:85/kanwoa/admin/login显示404
必须是http://localhost:85/kanwoa/index.php/admin/login
请各位帮助一下!谢谢了 重写没成功,开了rewrite_module没? 本帖最后由 qi_ruo 于 2010-10-11 19:53 编辑
先保证加载rewrite_module
httpd.conf文件里 #LoadModule rewrite_module modules/mod_rewrite.so 这一行前去掉注释,重启Apache
其次在根目录(kanwoa)下 加上.htaccess文件
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /kanwoa/index.php/$1
</IfModule>
<IfModule !mod_rewrite.c>
ErrorDocument 404 /kanwoa/index.php
</IfModule> 留着吧。我已经觉得恶心了。服务器千奇百怪有的支持有的不支持。你如果是老板那么请打电话直接问服务器供应商的技术人员。 mvc的入口文件当然不能没有了,你可以配置下apache .haccess文件,默认所有请求都到Index.php就可以了.
页:
[1]