[Tutorial] ApacheRewrite path exception tutorial

Source: Internet
Author: User
[Tutorial] the ApacheRewrite path is incorrect. the DocumentRoot path of the VM is/var/www/html/dir1/dir2rewrite. The rule is written in the. htaccess file. RewriteEngine & nbsp; onRewriteB [Tutorial] Apache Rewrite path error tutorial
The DocumentRoot path of the VM is/var/www/html/dir1/dir2.
The rewrite rule is written in the. htaccess file.


RewriteEngine on
RewriteBase /
RewriteRule rewrite.html index.php

At this time, the access is normal.

If Changed:

RewriteEngine on
RewriteBase /
RewriteRule rewrite.html index.php [P,L]

An error occurs. chrome returns:
The requested URL/var/www/html/dir1/dir2/index. php was not found on this server.
It should be 404, right?

What is the cause of this error and how to handle it.
------ Solution --------------------
P (force proxy) enforces proxy forwarding.
L (last rule) indicates that the current rule is the last rule. after the analysis is stopped, the rule is overwritten.

I don't understand why P
------ Solution --------------------
Reference:
Reference: RewriteRule rewrite.html index. php [NC]
Try modifying with NC


Thank you. let me try it.
How
------ Solution --------------------
Reference:
Reference: P (force proxy) enforces proxy forwarding.
L (last rule) indicates that the current rule is the last rule. after the analysis is stopped, the rule is overwritten.

I don't understand why P

I don't quite understand either.
Because of a project, I just started to learn rewrite, which is very white.
In some examples, P is added.

Yes. In any case, if P is added, this is the case ......


Delete P.

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.