I have a website hosted on 000webhost and a paid domain was purchased from 1and1. 1and1 offers URL redirecting with HTTP or frame redirect, but I have opted to point the paid domain to 000webhosts name servers.
Currently this works to the point that when I type the paid domain in (www.paiddomain.co.uk), it points me to the correct website (www.freedomain.com). Once on this page any page that is clicked shows up in the address bar as www.freedomain.com/link when what I want is for it to show up as www.paiddomain.com/link.
What's the best way of doing this?
In your case the origin server is freedomain.com. It sounds like you opted out of a proxy server and just have the DNS pointing to the origin server.
The first page loads fine because it is accessible by two domains. However the HTML content that was delivered has absolute links to the origin server. Therefor when the client clicks on it they are taken directly to the origin server.
This depends on how your pages are generated (static html, drupal, wordpress, custom app). But the net effect is that your links will be generated like this:
<a href="http://www.paiddomain.com/link">absolute URL</a>
or like this:
<a href="/link">relative URL</a>
If your site uses cookies you will also need to figure generate them for the correct domain.
For systems that generate an absolute URL they will usually have a variable that stores the "site url", "base url", or similar either in their configuration or in the database.
You can ask your proxy server to translate links (and cookies, etc) from freedomain.com
to paiddomain.com
. This depends on the proxy server, in apache you would use ProxyPassReverse
.
1and1 is apparently not willing to be your proxy server: http://faq.1and1.com/domains/domain_admin/domain_dest/3.html They are willing to provide a frame (poor bookmarkability), or HTTP redirect (change the URL).