Hi,
I am trying to do a 301 redirect (from one subdomain to other domain's subdomain) and I would need to do that without changing the URL in the address bar.
Here is the rule I have at .htaccess of subdomain.domain1.com:
Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) http://subdomain.domain2.com/$1 [R=301,L]
Result:
When I invoke subdomain.domain1.com it is changing the URL to
http://subdomain.domain2.com/
Many thanks More info:
- I tried to use DNS CNAME redirect but it was opening
http://domain2.com/
and not
http://subdomain.domain2.com/
- I tried
<?php header( 'Location: http://subdomain.domain2.com/', true, 301 ); ?>
but it changed URL