. htaccess Rewrite Apache rewrite and configure

Source: Internet
Author: User

1 First:2 It is only valid to have space support Rewrite and file parsing for. htaccess in the Site Directory .3 How to make space support for rewrite and. htaccess file parsing? look down.4 The first step: To find the Apache installation directory of the Httpd.cof file, found in the5 <Directory/>6 Options followsymlinks7 allowoverride None8 </Directory>9 change None,Ten Step Two: Find the following: One #LoadModule rewrite_module modules/mod_rewrite.so A instead - LoadModule rewrite_module modules/mod_rewrite.so - Step three: Save reboot Apache.  the OK.  - followed by the rules of writing for. Htaccess: - . htaccess Add the following : - Rewriteengine on + Rewritebase/ - rewriterule ^ (. *) List-id ([0-9]+) \.html$ $1/company/search.php?sectorid2=$2 +Rewriterule ^ (. *) cominfo-([a-z0-9]+) \.html$ $1/member/index.php?uid=$2&type=cominfo ARewriterule ^ (. *) list-([0-9]+)-([0-9]+) \.html$ $1/plus/list.php?typeid=$2&pageno=$3 at Rewritecond%{http_host} ^[a-z0-9\-]+\.lujin\.com$ - Rewritecond%{http_host}!^ (Www|bbs) \.lujin\.com$ - rewriterule ^/?$/%{http_host} - rewriterule ^/([a-z0-9\-]+) \.lujin\.com/?$/member/index.php?uid=$1 [L] -  - some of the explanations above in rewriterule ^ (. *) List-id ([0-9]+) \.html$ $1/company/search.php?sectorid2=$2 - This is the classification of the Enterprise Library pseudo-static processing to originally assumed the access address is http://www.xxx.com/company/search.php?sectorid2=1 + now the address is http://www.xxx.com/list-id1.html - Advantages: 1, pseudo-static processing to accelerate the search engine revenue the 2, address map to the root directory, increase the weight, improve the ranking * 3, do not know what else ... $ Panax NotoginsengRewriterule ^ (. *) list-([0-9]+)-([0-9]+) \.html$ $1/plus/list.php?typeid=$2&pageno=$3 - This is a list of categories such as supply and demand, similar to the above principle, to the page to modify the corresponding the  + Below is the two-level domain name scheme for member space A the premise is to set the domain name to pan-parse the Rewritecond%{http_host} ^[a-z0-9\-]+\.lujin\.com$ + Rewritecond%{http_host}!^ (Www|bbs) \.lujin\.com$ - rewriterule ^/?$/%{http_host} $ rewriterule ^/([a-z0-9\-]+) \.lujin\.com/?$/member/index.php?uid=$1 [L] $ assuming the original address is http://www.xx.com/member/index.php?uid=admin - now the address is http://admin.xx.com -You can just put this on where you want to be, for example, you can use [field:writer/] to get the user name in the list page, then you can link the member space directly on the list page, which can be written as http://[field:writer/].xx.com

. htaccess Rewrite Apache rewrite and configure

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.