Apacherewrite to nginx experience-Support for braces

Source: Internet
Author: User
In nginx, This example shows the rewriteexample (%0-9%%5%%%.html $ x. jsp? Id1_1last is beyond the control of law. The solution is to add two dual-index rewritenumbers (%0-9%%5%%%.html $ x. jsp? Id $1 last; So OK, it can be said that it is fully compatible with the apache syntax, just change the RewriteRule to Rewrite, followed

Write rules like this in nginx

ReWrite^/(%0-9%%5%%%.html $/x. jsp?Id= $1 last;

Cannot be started. The solution is to add two double quotation marks

Rewrite ^/(%0-9%%5%%%%.html $/x. jsp? Id = $1 last;

This is OK. It can be said that it is fully compatible with the apache syntax. You only need to change the RewriteRule to Rewrite, and the subsequent changes can be as follows:

[R]-> rEdIrect;
[P]-> last;
[R, L]-> redirect;
[P, L]-> last;
[PT, L]-> last;

Nginx rewrite supports four types of redirection:

Jump type
Redirect: 302 jump to the address after rewrite
PeRmAnent: 301 is permanently directed to the address after rewrite, which is more friendly to search engines.

Proxy type
Last: re-run the rewrite address in the server tag.
Break: place the address after rewrite in the current loCatExecute in ion label
 

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.