I have a WordPress site hosted on Siteground with a name like [realsitename.com](https://realsitename.com/). It has a page called [realsitename.com/specialpage](https://realsitename.com/specialpage).
What I want is when someone enters [othersitename.com](https://othersitename.com/) in their browser, it gets redirected to [realsitename.com/specialpage](https://realsitename.com/specialpage) with masking, so it looks to the user like they are on [othersitename.com](https://othersitename.com/). Currently, [othersitename.com](https://othersitename.com/) is parked on the web server and its DNS is correctly pointing to the server.
Below is the code I have at the bottom of htaccess that isn’t quite working:
RewriteEngine on
RewriteCond %{HTTP_HOST} othersitename.com [NC,OR]
RewriteCond %{HTTP_HOST} ^www.othersitename.com [NC]
RewriteRule ^(.*)$ ^/specialpage [L,R=301,NC]
But the result of entering [othersitename.com](https://othersitename.com/) in the browser is that you get redirected to [http://othersitename.com/%5erealsitename.com/specialpage](http://othersitename.com/%5erealsitename.com/specialpage), which is a 404 error. What am I doing wrong?
Just set ‘specialpage’ to be your homepage. Or do you only want it to happen for that specific domain name?
Try setting the RewriteRule to be the absolute address, rather than the relative.
Have you look at this free plugin? [https://wordpress.org/plugins/multiple-domain-mapping-on-single-site/](https://wordpress.org/plugins/multiple-domain-mapping-on-single-site/)