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

WBOY
풀어 주다: 2016-06-13 13:37:48
원래의
789명이 탐색했습니다.

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>
로그인 후 복사
관련 라벨:
원천:php.cn
본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
인기 튜토리얼
더>
최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿
회사 소개 부인 성명 Sitemap
PHP 중국어 웹사이트:공공복지 온라인 PHP 교육,PHP 학습자의 빠른 성장을 도와주세요!