Apache rewrite and options MultiViews have to say the secret

Source: Internet
Author: User

Os:ubuntu 14.01

Web server:apache/2.4.12

Pseudo-static removal of index.php using TP frame

. htaccess content:

Rewriteengine on
Rewritecond%{request_filename}!-d
Rewritecond%{request_filename}!-f
Rewriterule ^ (. *) $ index.php/$1 [qsa,pt,l]

Access Address: Http://domain/index/test

Apache jump 404 Not Found

Discover through Google

Http://stackoverflow.com/questions/21698245/404-returned-though-rewrite-rule-is-matched

Need to change configuration on the virtual host profile, my native virtual host configuration already has options multiviews, need to change

Options-multiviews
Find out more about the information

multiviews:

    • Using a ' multiviews ' search, where the server does an implicit filename pattern match and chooses from among the results.
English is a little slag, the following is the translation results

make an implicit filename pattern match and select the result on the server.

If the access address is http://domain/index/test and the root directory has index.php, the address is resolved to http://domain/index.php/test

In the rewrite Index/test,apache will look for the directory under the index.php file, if you have access to this file, similar if the address is other/info, will look for other.php file

Apache rewrite and options MultiViews have to say the secret

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.