<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