apache_conf [server]将旧域重写为新域

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了apache_conf [server]将旧域重写为新域相关的知识,希望对你有一定的参考价值。

#rewrite all subdomain on old domain to subdomain on new domain
RewriteCond %{HTTP_HOST} ^(.*)\.olddomain\.com$ [NC]  
RewriteRule ^(.*)$ http://%1.newdomain.com/$1 [R=301,L]

# rewrite all links to new domain
RewriteEngine on 
RewriteRule ^(.*)$ http://www.newdomain.com/$1 [R=301,L]

以上是关于apache_conf [server]将旧域重写为新域的主要内容,如果未能解决你的问题,请参考以下文章