. htaccess the scope of the wording of the document _linux

Source: Internet
Author: User
Too many friends will encounter a problem, that is htaccess file conflict problem, for example, a site, the whole station is pseudo static, and is used by the virtual host, Then you have to use the. htaccess file rules to achieve, while using the CMS file portal with DZ do BBS, with WP do blog, I only know WP and DZ program static will exist conflict, may lead dz static file invalidation. In this way, the scope of the htaccess file is used.
Here is a basic and most standard htaccess file:
Copy Code code as follows:

# BEGIN
<ifmodule mod_rewrite.c>
Rewritebase/products
Rewriteengine on
Rewriterule ^index-page ([0-9]*) (/) $ index.php?page=$1
Rewriterule ^ ([0-9]+) (/) $ products.php?id=$1
</IfModule>
# End

The Rewritebase property of this file is the scope, not just the. htaccess file placement location, this attribute is an absolute path, and of course the. htaccess's stored path, and all of the following rules will take effect relative to this path.
In this way, WP and DZ conflict can be resolved, WP htaccess files can be placed under the blog, and then the BBS directory decentralized htaccess DZ. Of course, if all is placed in the root directory, may also conflict, but, how many people put the same program in a directory? Not only is not easy to manage, to the later program upgrades also bring a lot of trouble.

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.