Forum Moderators: buckworks & webwork

Message Too Old, No Replies

Can a domain resolve to a directory on a different domain?

         

helleborine

6:56 pm on Feb 16, 2005 (gmt 0)

10+ Year Member



I have made a website for a friend that is hosted on my-domain.com/her-subfolder.

Now she bough her own domain name her-domain.com

She doesn't want to pay for hosting, but she wants her-domain.com to serve the contents of my-domain.com/her-subfolder.

Can this be done? Please explain as if I were a three year-old.

Thanks...

albo

7:13 pm on Feb 16, 2005 (gmt 0)

10+ Year Member



If I understand correctly, she wants to place HER web files in YOUR webspace. If so, yes, that is possible. I have three other websites sharing my space through a mechanism my host calls "aliasing". Their domain names point to mine. When someone enters www.theirdomain.com the call goes to www.mydomain.com and I wrote myindex.htm to use a javascript to read [their-location.href...] and then use javascript's location.href to redirect the client to correct-home-page.htm and I hope this long-winded description is clear to you...

helleborine

8:17 pm on Feb 16, 2005 (gmt 0)

10+ Year Member



Such good news! Yes, I understand what you are doing. Would you be able to share the script?

encyclo

8:37 pm on Feb 16, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Without wanting to shoot down albo's suggestion completely, there are nevertheless some serious problems with the method proposed. The first is that no search engine bots will react to a javascript redirect, so your friend's site will appear to be your own - your content under their domain name. Secondly, as there would be two domain names pointing to your site and showing the same content, not only is your friend's site not indexed at all, but also your site could well be penalised for having duplicate content showing up under two domain names. Also, up to 15% of users have Javascript disabled, and they wouldn't be redirected either.

If you want to use domain aliasing, then you need to use a server-side technology (mod_rewrite, PHP, ASP...) to send a 301 permanent redirect which will be transparent to the end-user and the spider - in other words, the real subdirectory address would show. The other, and better, solution would be to contact your hosting company - most allow you to host a second site within a subdirectory of your main hosting, with the second domain name properly ailiased to that subdirectory. It's not usually free, but usually much cheaper than a second hosting deal.

albo

9:09 pm on Feb 16, 2005 (gmt 0)

10+ Year Member



Yes, it's not free, but it is cheaper than a second hosting deal. It does allow independent searching through google etc. search engines, and does not necessitate sharing of pages in my case as my javascript distinguishes in all cases between using clients and pages and does not allow nonexplicit jumping between websites (the websites share some javascript and CSS code for MY convenience inasmuch as the sites themselves bear some similarities). I'm not quite up to speed on jargon so I don't know what a "301" jump is, but I know that the method I've used for location.href works and individual /*meta records for the individual site files seem to add searchability discreet to the aliased site names. As for the aliasing price, it was a certain price for the first, then a much smaller price for the second and subsequent aliases...

albo

9:15 pm on Feb 16, 2005 (gmt 0)

10+ Year Member



p.s., given that webhosting and subsequent aliasing will not be COMPLETELY free, if you STILL want some javascript code, I'll post it here.

helleborine

9:18 pm on Feb 16, 2005 (gmt 0)

10+ Year Member



I'm doing this as an unpaid favor. I'm going to tell her that if she wants to use her-domain.com, she'll have to get her own hosting service.

I have some rather popular material on my-domain.com, and I don't want to monkey around with my Google ranking!