How to mask a url in wordpress

1.2k views Asked by At

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

There are 1 answers

0
Mustafa sabir On

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