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

WBOY
Release: 2016-06-13 13:37:48
Original
788 people have browsed it

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 On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
<br><font color="#e78608">------解决方案--------------------</font><br>
重启apache没 <div class="clear">
                 
              
              
        
            </div>
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!