Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've currently got an ASP.Net site hosted with DiscountASP.Net what I would like to do now is put a second site in a subdirectory of this original site and register a new domain to point at the subfolder, so to the end user its 2 completely seperate sites. I've asked DiscountASP support if they could do this and they just say they dont support it and wont help.

If I registered the second domain with someone like 123-reg is it possible to make that domain point to a subdirectory in my main site?

If not I may have to put some sort of redirect on my route index page that sends you to the right page based on the URL you requested but I would really rather not have to go there. I don't want to buy an additional account as the second site is just a bit of a side project that may well go no where.

share|improve this question

migrated from superuser.com Feb 8 '10 at 10:02

This question came from our site for computer enthusiasts and power users.

2 Answers 2

up vote 0 down vote accepted

You cannot point a domain name to any directory, it's the web server which does that job.

A domain name points to a web server with a specific ip-address. If your web hotel doesn't support several domain names with their own folders, then there's not much you can do about that.

What you can do is to check with them if they support so called "multiple domain pointers". It means that multiple domain names point to a certain domain name, and server directory. Then you can write a .net-script which takes care of the redirects depending on the domain name the user types in, just like you have mentioned.

share|improve this answer
    
I realise I cant point a domain at a directory but was wondering if any registras/DNS hosts would allow me to do some sort of silent forward on the domain name. Looks like I may have to implement something myself. –  Gavin Dec 8 '09 at 18:04
    
Some web hosting companies/registrars do that, it's called "domain forwarding". But since DNS doesn't have support for directories, you will end up with a frames solution. –  TFM Dec 8 '09 at 20:16

If you use Everydns as your dns provider, you can do redirects...

...However, see if discountasp.net allows you to set host headers / additional domains or anything similar and if they do, simply set one for your new domain then Set DNS records to be the same as your existing one and then in your default/index page (assuming ASP) write something along the lines of:

<% if request.servervariables("SERVER_NAME") = "mynewdomain.com" or request.servervariables("SERVER_NAME") = "www.mynewdomain.com then
response.redirect("/newsite")
end if %>

This should then forward anyone with the correct domain name to the sub directory of newsite.

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.