How to mask a url in wordpress

Viewed 327

Is it possible to mask a url to a new domain in wordpress?
For example: URL : abc.com/test
I want the content of abc.com/test but the url to be changed to xyz.com.
I have tried adding .htaccess code but it did not work.

1 Answers

You can 301 redirect from abc.com/test to xyz.com but the wordpress deployment should be running on xyz.com

RewriteEngineOn
RewriteCond%{HTTP_HOST} ^abc.com/test RewriteRule ^(.*) http://newdomain.com/$1 [P] 

add this to the .htaccess file on abc.com/test path

Related