Who is the master to help the younger brother I send a. htaccess domain name to the file? Why not this one?
Source: Internet
Author: User
Who's going to send me a. htaccess domain name to file? Why can't this be?
Rewriteengine on
Rewritecond%{http_host} ^www.xxx.com$ [Or]rewritecond%{http_host} ^xxx.com$
Rewriterule ^/?$ "http\:\/\/www\.example\.com" [r=301,l]
Who's going to send me a. htaccess domain name to file? Why can't this be?
At the same time, there are five domain name 1.www.example.com,2.www.xxx.com,3.xxx.com,4.bbs.example.com;5.news.example.com in a space.
Features to implement:
When accessed with www.xxx.com,xxx.com, automatically jumps to www.example.com (the Address bar domain name appears as www.example.com) to the Space main page index.php.
When bbs.example.com comes to visit, point to Www.example.com/bbs Sub-page; (Address bar domain name is displayed as Bbs.example.com).
When news.example.com comes to visit, point to www.example.com/news Sub-page; (Address bar domain name is displayed as News.example.com).
------Solution--------------------
Domain jump has not been tried ... Did you not turn on the. htaccess directory identification?
Sub-page Jump words can use this
Rewritecond%{http_host} ^bbs.example.com$
Rewritecond%{request_uri}!^/bbs/
Rewritecond%{request_filename}!-f
Rewritecond%{request_filename}!-d
Rewriterule ^ (. *) $/bbs/$1
Rewritecond%{http_host} ^bbs.example.com$
Rewriterule ^ (/)? $bbs/index.php [L]
------Solution--------------------
Domain turn? Is it just a jump?
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.