0

I own two domains. domain.net is for my main website, and domain.com.au is just a vanity URL. How can I forward users to domain.net when they type in domain.com.au while keeping domain.com.au in the URL bar? I have control of both domains and I don't want to use an iframe. both domains are on 2 separate hostings. com.au-godaddy; .net-1and1

from what i have read goDaddy is com.au in an iframe at .net , which prevents the site from recognizing device width and being mobile friendly.

Serge
  • 1
  • 1

1 Answers1

0

Try the following in your .htaccess file for example.com.au:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www\.)?domain\.com\.au$
RewriteRule (.*)$ http://www.domain.net/$1 [P]

This uses mod_proxy to pass your request from the .com.au domain to the .net domain - the P flag is provided to allow you to do this.

Mike Rockétt
  • 8,947
  • 4
  • 45
  • 81
  • Then perhaps `mod_proxy` is not enabled on your server. You would be better off changing your vanity domain's DNS to point to the main server instead. Proxying does have its security woes, so DNS would be the better way to go. – Mike Rockétt Feb 14 '16 at 15:57