how to redirect new domain to sub page of old domain in htaccess

.htaccess

Solution

Try this code :

RewriteCond %{HTTP_HOST} ^www.newdomain.com$
RewriteRule ^(.*)$  http://www.mydomain.com/sub-page [R=301,L]

Problem

I have a wordpress site which is www.mydomain.com . This site has a page www.mydomain.com/sub-page I also have a new domain, www.newdomain.com which is pointed to the same root/site, but I want people that use this domain to get redirected to www.mydomain.com/sub-page Here is my htaccess, Im not sure of the syntax, but at the moment this is doing nothing, www.newdomain.com simply loads www.mydomain.com ``` RewriteCond %{HTTP_HOST} ^www\.newdomain\.com$ [NC] RewriteCond %{HTTP_HOST} ^newdomain\.com$ [NC] RewriteRule ^(.*)$ http://www.mydomain.com/sub-page [R=301,L] ```

Original source