The biggest free web hosting accounts. No ads. No strings. No tricks.

How do I assign a domain name to a separate directory of my website?

Share

URL Forwarding – Easy Peasy

Question:  Here’s my specific scenario…

I have both web hosting with WebHostingHub as well as a domain name. (http://www.mysite.com)

I have built another site under a separate directory, and assigned it a subdomain… (http://something.mysite.com)

I have registered a domain name at goDaddy. (http://www.anothersite.com)

I need (http://www.anothersite.com) to be assigned to the “something” directory. Right now, I have it set up as a simple forwarding, but the URL field on the browser will show (http://something.mysite.com) once the page loads.

I need either…

(1) The domain name (http://www.anothersite.com) to be directly assigned to the “something” directory on the website, or…

(2) The domain name (http://www.anothersite.com) to forward to the “something” directory, but remain as (http://www.anothersite.com) in the browser window, even when they enter other pages within the “something” directory.

Any thoughts?

Answer:  You can do this with something called URL masking.   The end result is, when you type NewDomainName.com into the browser’s address bar it will resolve to TargetSubDomain.com, but NewDomainName.com will appear in the address bar.

Here’s an example for NameCheap, but it works the same at GoDaddy.  You just access the host records in a different manner.

URL masking also known as URL Frame feature is available only if your domain is using the default nameservers.

To set it up please do the following:

  • Login to your Namecheap account;
  • Click on Manage Domains;
  • Click on the domain you wish to modify;
  • Click on All Host Records (or URL Forwarding);
  • Set up the required forwarding settings selecting URL Frame as a record type;
  • Click Save Changes.
 
 
Share