Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I rent a domain name, lets say MyFakeDomain.com (using GoDaddy, if it matters) and I rent a shared hosting that gave me an ugly url, lets say ugly.long-url.123456789.com (1and1.com, if it matters.)

As expected, when people go to MyFakeDomain.com, I want them to see the content of ugly.long-url.123456789.com. However, with the little I know about that, I was only able to do domain masking, but it also overrides all the webpage title by a static title. Even worse than that, if you go to MyFakeDomain.com and hover on a link, you would see http://ugly.long-url.123456789.com\[ThatLink.html].

What must I change in order to always hide the ugly.long-url.123456789.com from the users, and not overwrite the titles of every page?

Is it something in the zone file and zone records? (A, CNAME, etc.) If so, any resources you know that could explain all this clearly to me?

Thanks

share|improve this question

2 Answers 2

It depends on the hosting environment and if you have access to ugly.long-url.123456789.com.

The basic idea behind this all is: you have the DNS system where you store A, CNAME, etc records. These records help the browser identify the server the site is hosted on. However, the server has to be configured to actually handle that domain, so it needs to know what content it should serve for MyFakeDomain.com.

If you have a proper hosting package for ugly.long-url.123456789.com, you should be able to add the domain to it. If in doubt, ask your hosting provider. This is the cleans and probably most stable way to do it. If you can't do this, you can't do it with just A and CNAME records.

If you do have for example a PHP hosting package you can redirect your nice address to, you could write a proxy script that forwards all requests to ugly.long-url.123456789.com and changes the links in the response to your nice domain name. This requires a bit of programming. A good starting point is the curl documentation.

If you don't have access to a PHP host for your nice domain, but you can deploy some basic HTML and JavaScript, you could change all your URL's on ugly.long-url.123456789.com. This link:

<a href="http://ugly.long-url.123456789.com/mysite.html">sometext</a>

becomes this:

<a href="http://MyFakeDomain.com/#/mysite.html&amp;title=This%20is%20my%20title" target="_top">sometext</a>

On MyFakeDomain.com you would then deploy a script that reads the hash part of the URL and loads an iframe for it. (window.location.hash in JS)

share|improve this answer

What I had to do was to change the Nameservers on the Domain registrar (GoDaddy) to point to the Nameservers of the Domain host (1and1.) This way, the latest handles all the underlying mechanism, and the domain registrar just delegates all his responsibilities on the host.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.