Click to See Complete Forum and Search --> : URL Redirection


Vengeance000
03-05-2003, 11:05 AM
I have a somewhat complex question. I have 2 web domains that I want to register, one will probably get a lot of traffic and the other will probably not. So I contacted my web hosting service, to see if they could point the second domain to a subfolder of the account I have with them for the first one. So that I could simply share the bandwidth and filespace of those two pages from my one account. But they say they are unwilling to do this, and all new domains can only point to the main directory of my account.

So, I was wondering if there was any way to have my index page check which address they entered and then redirect them to a subfolder for that page. Such as obviousexample.com and otherexample.com both open the same homepage, but that homepage reads which address was entered, and then redirects the user to the proper homepage, such as obviousexample.com/page2/. Is there any way to do this? Any help would be greatly appreciated. Thanks.

RaiN
03-05-2003, 05:25 PM
in the <body> tag try putting 'onLoad="window.redirect='url'"

jpmoriarty
03-06-2003, 03:58 AM
unfortunately that's not going to cover the "domain redirection" that he's after - that will only work on a "page by page" basis.

If you want something that, for example, redirects www.thisdomain.com/file.html to www.anotherdomain.com/thisdomain/file.html where file.html can be anything (including subdomains etc) then that has to be set up at the server: the only way to do it with HTML would be to hard code each page i would have thought to redirect you to the other site - far from ideal.

I am hosted with serversonic, and they do a similar thing for their subdomain options: i have my subdomain "http://godspell.siteprefect.com" which redirects to "http://www.siteprefect.com/bedgebury/godspell/" - so if someone types in "http://godspell.siteprefect.com/page2.php" they get taken to "http://www.siteprefect.com/bedgebury/godspell/page2.php". It's very handy, but as i say, is one of the things that i had to set up in the control panel and i would thing you'd have to get in touch with your ISP to get it going.

Or alternativly move over to serversonic (http://www.serversonic.com) - they're very good!