Forum Articles
  Welcome back Join CF
You are here You are here: Home | Forum | Bluetooth

You are currently viewing our boards as a guest which gives you limited access to view most of the discussions, articles and other free features. By joining our Virgin Media community you will have full access to all discussions, be able to view and post threads, communicate privately with other members (PM), respond to polls, upload your own images/photos, and access many other special features. Registration is fast, simple and absolutely free so please join our community today.


Welcome to Cable Forum
Go Back   Cable Forum > Computers & IT > General IT Discussion
Register FAQ Community Calendar

Redirecting Users
Reply
 
Thread Tools
Old 19-08-2003, 23:25   #1
Seb
Inactive
 
Join Date: Jun 2003
Location: Cambs
Posts: 147
Seb is an unknown quantity at this point
Redirecting Users

I currently have two domains registered, lets call then company.com and companyonline.com. The problem is though, that i only have one webspace account.

So here goes:

If a user goes to companyonline.com they are currently forwarded (set up by webhost) to the index page on the webspace. However i would like users to be redirected to a directory on my webspace. I know that i could ask the user which domain name they entered, but thats not very professional for a business website. Therefore i was wandering if any body knows how to sort out this issue, or if there is any free downloads on the net that any one could recommend??

I know that probably doesn't majke too much sense, so i apologise in advance!! Just ask if your not sure, thanks.

Seb
Seb is offline   Reply With Quote
Advertisement
Old 20-08-2003, 00:38   #2
philip.j.fry
Inactive
 
philip.j.fry's Avatar
 
Join Date: Jul 2003
Posts: 1,395
philip.j.fry has reached the bronze age
philip.j.fry has reached the bronze agephilip.j.fry has reached the bronze agephilip.j.fry has reached the bronze agephilip.j.fry has reached the bronze age
I may not be entirely correct in this, but I think that what you need to do is contact your webspace provider and they will then set up their server configuration to forward users to the correct page.

Another way would be to have a script on the initial page to redirect the user to the correct page, you could do this on the server side with something like php or cgi if allowed, or on the client side with javascript.
philip.j.fry is offline   Reply With Quote
Old 20-08-2003, 01:18   #3
Richard M
Inactive
 
Join Date: Jun 2003
Location: Los Angeles, CA
Age: 47
Posts: 6,343
Richard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze array
Richard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze array
Most decent hosts have got PHP, just put something like this at the start of the index.php file (not tested) :

Quote:
<?php

$entrydomain = getenv("HTTP_REFERER");

if ($entrydomain = "www.companyonline.com")
{
header("Location: http://www.company.com/site1/");
}

else
{
header("Location: http://www.company.com/site2/");
}

?>
Richard M is offline   Reply With Quote
Old 20-08-2003, 01:46   #4
philip.j.fry
Inactive
 
philip.j.fry's Avatar
 
Join Date: Jul 2003
Posts: 1,395
philip.j.fry has reached the bronze age
philip.j.fry has reached the bronze agephilip.j.fry has reached the bronze agephilip.j.fry has reached the bronze agephilip.j.fry has reached the bronze age
or if they don't, use this javascript in the head portion of the first index page (for company.com). Just change the myHostName and correctLoc variables to what you need, make sure to keep the backslashes at the beginning and end of myHostName and put forward slashes in front of any periods.

Quote:

<SCRIPT language="Javascript">
function reDirect() {

var myHostName = /\.companyonline\.com/;
var correctLoc = "dir/page.html";
var url = window.location.href;
if (url.search(myHostName) != -1) {
document.URL = correctLoc;
}
}
</SCRIPT>
then in the body tags put

Quote:
<BODY LANGUAGE=javascript onload="reDirect()">
semi-tested
philip.j.fry is offline   Reply With Quote
Old 20-08-2003, 11:25   #5
Seb
Inactive
 
Join Date: Jun 2003
Location: Cambs
Posts: 147
Seb is an unknown quantity at this point
Cheers all, well I obviously dont have a 'decent' webhost (to be honest I already knew that!!) Yes Demon, you know that small little company , 'do not currently support ASP nor PHP, however their new web platform, due to be released in the next few months will!' So I have had to resort to the javascript from philip.j.fry.

Also I contacted Demon to ask then to set up the web forwarding to a directory on my webspace. 'We are only able to forward the domain to your webspace index page' Right well i'll do the work instead then. I can sense a move of webs hosts Has any body got any good suggestions and possibly link?? I'm looking for a host that support more scripting than CGI and Perl!!

Thanks very much for all ya help

Seb

P.S - I see that all of you managed to interprut my post as well, well done to you all.
Seb is offline   Reply With Quote
Old 20-08-2003, 13:29   #6
Richard M
Inactive
 
Join Date: Jun 2003
Location: Los Angeles, CA
Age: 47
Posts: 6,343
Richard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze array
Richard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze array
I used www.webfusion.co.uk for a while, they were excellent and their control panel is superb.
A little expensive but well worth it.
I also hear that www.oneandone.co.uk are pretty good too.
Richard M is offline   Reply With Quote
Old 20-08-2003, 15:49   #7
KingPhoenix
Inactive
 
KingPhoenix's Avatar
 
Join Date: Jun 2003
Location: On top of this heat sink
Age: 46
Services: Sky+ & 8mb ADSL + BT Together option 3
Posts: 2,345
KingPhoenix has a bronze arrayKingPhoenix has a bronze arrayKingPhoenix has a bronze array
KingPhoenix has a bronze arrayKingPhoenix has a bronze arrayKingPhoenix has a bronze arrayKingPhoenix has a bronze arrayKingPhoenix has a bronze arrayKingPhoenix has a bronze arrayKingPhoenix has a bronze arrayKingPhoenix has a bronze array
Send a message via MSN to KingPhoenix
If your after a new host, checkout I-Web Solutions ::: NTHW Members pricing
KingPhoenix is offline   Reply With Quote
Old 20-08-2003, 15:58   #8
Bifta
Inactive
 
Join Date: Jul 2003
Location: Eglinton, Co. Derry
Posts: 7,640
Bifta has a nice shiny starBifta has a nice shiny star
Bifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny star
You could also use something like

<script language="javascript">
if (document.referrer = "http://www.companyonline.com")
location.href = "http://www.company.com/wherever/"; '
</script>
Bifta is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:47.


Server: lithium.zmnt.uk
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
All Posts and Content are © Cable Forum