They want both their domain names to point to www.homesite.co.uk BUT they want different home pages for the 2 sites (all the other pages will be identical).
So if a user comes to the site via the .co.uk address he gets the UK home page, and all the other home page links in the site must take him back to it. And similarly if a user arrives via the .ie address he must get the Irish home page and all the relevant links must take him back to it.
Is this possible and if so how do I do it?
Hope that makes sense. Many thanks in anticipation!
Bob.
Have 3 seperate IP addresses (I would have 3 different hosts myself). On both the UK and Irish sites do a 301 redirect to the specific home page you made for them on the main site.
You could also do something like the following. You would direct both sites to your mains site and then add the script to the home page. (Windows server as example):
'---------------------------------------------------
host = lcase(request.servervariables("SERVER_NAME"))
select case host
case "www.example.com", "example.com"
' this domain would go to a different home page
response.redirect("www.example.com/page1.html")
case else
' DO NOTHING
' all other domains go to this home page
end select
'----------------------------------------------------
Could you explain in a bit more detail how to set up the script you suggested on my web page? Do I just paste the script into the <HEAD> section or is there more to it than that?
The site is hosted on a Windows server so the script is the right one, but I'm more familiar with PERL scripts than Windows.
Many thanks,
Bob.
I just had an idea that should work better for the search engines.
Place the script at the top of the page and then do a 301 redirect within SELECT statement.
Something like:
<%
host = lcase(request.servervariables("SERVER_NAME"))
select case host
case "www.example.com", "example.com"
' this domain would go to a different page via 301 redirect
Response.Status="301 Moved Permanently"
Response.AddHeader "Location", "http://www.example.com/new"case else
' DO NOTHING
' all other domains go to this home page
end select
%>
I tested this and it returns the correct server responses.
Can't get it to work - I'm probably doing something stoopid!
Just to check...
The script goes in the <head> section of the UK home page and tests to see whether the user has come from www.mysite.ie. Depending on the answer it either allows the user to see the UK page or redirects them to the Irish page. Right so far?
BTW is it an ASP script? ...and if so, do I need to call the page index.asp to get it to work?
Have I put my urls in correctly...?
<%
host = lcase(request.servervariables("my.ISP.servername"))
select case host
case "www.mysite.ie", "mysite.ie"
' this domain would go to a different page via 301 redirect
Response.Status="301 Moved Permanently"
Response.AddHeader "Location", "http://www.mysite.ie/index.htm"
case else
' DO NOTHING
' all other domains go to this home page
end select
%>
Sorry to ask you to spell it out for me!
Bob.
The script goes in the <head> section of the UK home page ...BTW is it an ASP script? ...and if so, do I need to call the page index.asp to get it to work?
The code I posted is ASP so the page will need a .asp extension - index.asp will work. You do *not* put the code between the head tags. Place it at the top of the page - above all other code or HTML.
If you still have problems, feel free to sticky me with your code.
Joe