简体   繁体   中英

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]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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