Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to direct a domain name to a subdirectory

Status
Not open for further replies.

bopritchard

Programmer
Jan 27, 2003
199
US
my functioning site is mycoolsite.com

but i also want to register the domain hercoolsite.com and have that directed to mycoolsite.com/hercoolsite.html

how is that accomplished...

understand i'm not hosting this site...i'm trying to figure out whether i can do this and what to tell my host
 
well in hercoolsite.com's index page put this

Code:
<script>
function redir() {
window.location='mycoolsite.com';
}
</script>
<body onLoad="redir()">
if you need any more help just post back here
Jammer1221
 
You could easily set DNS up to get to mycoolsite.com, but DNS deals with IP addresses and has no knowledge of subdirectories. So if you wanted hercoolsite.com to resolve to mycoolsite.com/hercoolsite.html, you would need to set up some types of virtual directories with multiple IPs on your web server. Or, you could just set up another site for hercoolsite.com on the web server, give it it's own IP address, and have it default to whatever directory you want, but I have a feeling you're trying to avoid that situation.






Hope This Helps!

Ecobb

&quot;My work is a game, a very serious game.&quot; - M.C. Escher
 
Ecobb said:
So if you wanted hercoolsite.com to resolve to mycoolsite.com/hercoolsite.html, you would need to set up some types of virtual directories with multiple IPs on your web server. Or, you could just set up another site for hercoolsite.com on the web server, give it it's own IP address, and have it default to whatever directory you want, but I have a feeling you're trying to avoid that situation.

There is no need for multiple IP addresses to do this, you can run as many sites on the same IP as you want.

bopritchard

Assuming you are using Apachwe, setup a Virtualhost with the same details as the current site, but switch the servername directive to use the subdomain and change the Documentroot to reflect the path on the system for the subdirectory. Doing this is just as easy as setting up a new domain name on the server.

Hope this helps

Wullie


The pessimist complains about the wind. The optimist expects it to change. The leader adjusts the sails. - John Maxwell
 
you need to get the host to set the home directory of hercoolsite to point to the physical location of the folder that is the subdirectory of mycoolsite. Same as with any other site so long as there is a default document in the subfolder it will work.

If you are trying to point to another document rather than a folder then the home directory will be the same for both sites but the default document will have to be set to suit. This it not recommended as many operations at the top level of IIS can change the default document names and order and your site could stop working.




Chris.

Indifference will be the downfall of mankind, but who cares?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top