欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

ZF .htaccess中怎么怎么去除固定的index.php

程序员文章站 2024-01-27 18:53:46
...
ZF .htaccess中如何如何去除固定的index.php
现在文件的结构与官方的一样。
public/index.php
application/controllers/indexController.php
现在我每次访问都要用到
localhost/test/public/index.php/index/index
,如何将这里的index.php用.htaccess去掉,
我现在的.htaccess文件内容如下:
RewriteEngine On

RewriteCond %{REQUEST_URI} ^index.php [OR]

RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
但是每次如果去掉index.php后页面就提示 找不到此页面。

我的apache中的三处AllowOverride All与LoadModule rewrite_module modules/mod_rewrite.so都已经改了。

请大家 给点提示,我在这里阻拦了很久。。。。。。。。


------解决方案--------------------
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]

应该差不多吧
------解决方案--------------------
你只要在url中不加index.php不就去掉了。
------解决方案--------------------
zend framework给出的.htaccess
PHP code
RewriteEngine OnRewriteCond %{REQUEST_FILENAME} -s [OR]RewriteCond %{REQUEST_FILENAME} -l [OR]RewriteCond %{REQUEST_FILENAME} -dRewriteRule ^.*$ - [NC,L]RewriteRule ^.*$ index.php [NC,L]
------解决方案--------------------
重启apache没
ZF .htaccess中怎么怎么去除固定的index.php

声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。

相关文章

相关视频