您好,欢迎访问一九零五行业门户网

哪位高手帮小弟我发个.htaccess域名传向文件?为什么这个不行

谁帮我发个.htaccess域名传向文件?为什么这个不行?
rewriteengine on
rewritecond %{http_host} ^www.xxx.com$ [or]rewritecond %{http_host} ^xxx.com$ 
rewriterule ^/?$ http\:\/\/www\.example\.com [r=301,l]
谁帮我发个.htaccess域名传向文件?为什么这个不行?
同时绑定在一个空间里的有五个域名1.www.example.com,2.www.xxx.com,3.xxx.com,4.bbs.example.com;5.news.example.com;
要实现的功能:
当用www.xxx.com,xxx.com来访问时,自动跳转至www.example.com(地址栏域名显示成www.example.com)指向空间主页面index.php。
当bbs.example.com来访问时,指向www.example.com/bbs 子页面;(地址栏域名显示成bbs.example.com)。
当news.example.com来访问时,指向www.example.com/news 子页面;(地址栏域名显示成news.example.com)。
------解决方案--------------------
域名跳转没试过。。。是不是你没开启.htaccess目录识别?
子页跳转的话可以用这个
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]
------解决方案--------------------
域名转向?是不是就是跳转呢?
其它类似信息

推荐信息