Scope of action of. htaccess file writing

Source: Internet
Author: User

Too many friends may encounter a problem, that is, the issue of htaccess file conflicts. For example, if a site uses a pseudo-static whole site and a virtual host, it must be used. htaccess file rules are implemented. At the same time, CMS files are used as portals and DZ is used as BBS and WP is used as blogs. I only know that there will be conflicts between WP and DZ static programs, the static files of DZ may become invalid. In this way, the role of the htaccess file is used.
Below is a basic and standard htaccess file: Copy codeThe Code is 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 attribute of this file is the scope of action, not just. the location where the htaccess file is stored. This attribute is an absolute path. the path where htaccess is stored, and all the following rules will take effect for this path.
In this way, the conflict between WP and DZ can be solved. You can put the WP htaccess file under the blog, and then place the bbs directory to the dz htaccess. Of course, if they are all in the root directory, there may be conflicts. However, how many people put different programs in one directory? It is not only difficult to manage, but will also cause a lot of trouble for future program upgrades.

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.