Modify. htaccess Implementing a subdirectory binding sample sharing

Source: Internet
Author: User

<ifmodule mod_rewrite.c>
Rewriteengine on
Rewritebase/
# Change the www.jb51.net to the domain you want to bind.
# If it is a domain name: Rewritecond%{http_host} ^ ((Www|blog) \.)? jb51\.net$
Rewritecond%{http_host} ^ ((Www|blog) \.)? 127.0.0.1$
# change WWW to the directory you want to bind.
Rewritecond%{request_uri}!^/www/
# No modifications are required below.
Rewritecond%{request_filename}!-f
Rewritecond%{request_filename}!-d
# change WWW to the directory you want to bind.
Rewriterule ^ (. *) $/www/$1
# Change the www.jb51.net to the domain you want to bind
# change WWW to the directory you want to bind.
# www/Back is home file index.php, index.html
# If it is a domain name: Rewritecond%{http_host} ^ ((Www|blog) \.)? jb51\.net$
Rewritecond%{http_host} ^ ((Www|blog) \.)? 127.0.0.1$
Rewriterule ^ (/)? $ www/index.php [L]
</IfModule>

Htaccess how to jump from a specified domain name to a specified page

Rewriteengine on
Rewritecond%{http_host} ^tool.oschina.net [NC]
Rewriterule ^.*$ Http://www.oschina.net/question/ask?project=Apache [R=301,L,NC]

Modify. htaccess Implementing a subdirectory binding sample sharing

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.