Search code examples
.htaccessdnshostingmaskingforwarding

How do I keep my original domain in the URL bar when forwarding?


I own the domain portraittwo.co.uk - I also own portrait-london.co.uk - The later site currently has a hosting package attached and currently has a Wordpress installation running. I’ve installed a second installation at portrait-london.co.uk/wpinstall and I now want to forward the portraittwo.co.uk domain to /wpinstall on the second domain however I don’t want the domain in the URL box to change. Is this possible? If so how can I achieve this?

Note: On portraittwo.co.uk there is no hosting attached so I cannot edit .htaccess


Solution

  • This can be easily achieved if your host offers CPanel. In this case all you need to is add an addon domain portraittwo.co.uk and set its root directory to public_html/wpinstall. However, as I can see your host does not offer that and since you do not have hosting for portraittwo.co.uk and you do not have a valid DNS zone and a.htaccess file, I do not think that there is a way to do it.You can get a free hosting account for portraittwo.co.uk just for the sake of getting an .htaccess file and then set a rule :

    RewriteCond %{HTTP_HOST} ^portraittwo.co.uk
    
    RewriteRule ^(.*) http://portrait-london.co.uk/wpinstall [P]
    

    This should do the trick.