How to remove fixed index. php in ZF. htaccess

Source: Internet
Author: User
In ZF. htaccess, how does one remove fixed index. php? the structure of the current file is the same as that of the official one. Public/index. phpapplication/controllers/indexController. php now I use localhost/test/public/index for every access. php/index/in ZF. how to remove a fixed index in htaccess. php
The structure of the file is the same as that of the official one.
Public/index. php
Application/controllers/indexController. php
Now I need to use
Localhost/test/public/index. php/index
, How to remove index. php from. htaccess,
The content of my current. htaccess file is as follows:
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]
However, if index. php is removed each time, the page prompts that the page cannot be found.

In apache, AllowOverride All and LoadModule rewrite_module modules/mod_rewrite.so have All been modified.

Please remind me that I have been blocking it for a long time ........


------ Solution --------------------
RewriteCond % {REQUEST_FILENAME }! -D
RewriteCond % {REQUEST_FILENAME }! -F
RewriteRule ^ (. *) $ index. php/$1 [QSA, PT, L]

It should be similar.
------ Solution --------------------
If you do not add index. php to the url, it will not be removed.
------ Solution --------------------
. Htaccess provided by zend framework
PHP code
RewriteEngine OnRewriteCond % {REQUEST_FILENAME}-s [OR] RewriteCond % {REQUEST_FILENAME}-l [OR] RewriteCond % {REQUEST_FILENAME}-dRewriteRule ^. * $-[NC, L] RewriteRule ^. * $ index. php [NC, L]
------ Solution --------------------
Failed to restart apache

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.