Method of making non-pseudo static URLs jump to pseudo static URLs in Apache _linux

Source: Internet
Author: User

How to use. htaccess make non-pseudo static page 301 jump to pseudo static page and then jump? This is a comparison of egg pain jump. Cause the page won't open because it's a dead loop. Fortunately, the problem was finally resolved. Record and share it, and give reference to the friends who need it.

The rules are as follows:

Rewriterule ^article-([0-9]+). html$/article.php?id=$1&r=1 [L]

Rewritecond%{query_string} ^id= ([0-9]+) $ [NC ]

rewriterule ^article.php$/articlel-%1.html? [l,r=301]

Attention:

To create a. htaccess file, Windows does not allow files to be named. At the beginning, we can use Ue/editplus and other tools to save as. htaccess to achieve.
After creation, modify the. htaccess file content for your program corresponding to the pseudo static rules, uploaded to the program file directory can be implemented. Here's the program file directory look at the FTP directory structure. Here are some rules for common programs

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.