简体   繁体   English

将域重定向到另一个具有相同子文件夹结构的域

[英]Redirect domain to another domain same subfolder structure

I want to redirect domain to another domain and same subfolder structure 我想将域重定向到另一个域和相同的子文件夹结构

for example :- 例如 :-

http://www.domain.com/forum

will be redirect to 将被重定向到

http://www.domain.net/forum

thanks 谢谢

I hope it helps: 希望对您有所帮助:

RewriteCond %{HTTP_HOST} ^(www\.)?domain.com$ [OR] 
RewriteCond %{HTTP_HOST} ^(www\.)?domain.org$ 
RewriteRule (.*)$ http://domain.net/$1 [R=301,L]

Try this 尝试这个

RewriteCond %{HTTP_HOST} ^(www\.)?domain.com/$
RewriteRule ^(.*)$ http://www.domain.net/$1 [R=301,L]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM