.htaccess文件怎么做301

WBOY
Release: 2016-06-13 10:08:14
Original
985 people have browsed it

.htaccess文件如何做301
我想把这个地址www.bbbb4.com/www.xxx.com.html做301到
www.bbbb4.com/www_xxx_com.html

其中www.xxx.com是一个域名(不固定),有可能有N个点如
www.xxx.xxx.com
www.aaaa.net
www.bbbb.org等等


我的意思就是把域名中的“.”换成“_”

www.bbbb4.com/www.xxx.xxx.com.html就301到
www.bbbb4.com/www_xxx_xxx_com.html

请把代码写出来谢谢。

------解决方案--------------------
同求!
------解决方案--------------------
RewriteEngine On 
RewriteCond %{HTTP_HOST} !^www.bbbb4.com/www.xxx.xxx.com.html$ [NC] 
RewriteRule ^(.*)$ www.bbbb4.com/www_xxx_xxx_com.html/$1 [L,R=301]

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!