Jump to content

one site two domains


shaneR
 Share

Recommended Posts

HI i wonder if anyone knows any neat code to place onto my site?Basically i have two different domain names running from the same site and i need to have a different logo display depending on the URL used to access my site.Any ideas?

Link to comment
Share on other sites

If you are looking for a client-side solution, it could look something like this in java script:

<img id="LogoImage" width="500" height="60" />

var img = document.getElementById("LogoImage");if(location.href.indexOf("firstdomain.com") > -1){	img.src = "firstdomainlogo.gif";}else{	img.src = "seconddomainlogo.gif";}

Link to comment
Share on other sites

  • 2 weeks later...

Thanks for your input!!I have found some similar code to that above which works really well please see below i hope this helps others out who have the same problem as me.<%strServerName = Request.ServerVariables("SERVER_NAME")If InStr(strServerName, "mydomain.com") Then strImage = "<img src=""first image"" width=""473"" height=""35"">"Else strImage = "<img src=""ialternate image"" width=""404"" height=""38"">"End If%>Place the below string where you want the image(s) to be displayed.<%= strImage %>

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...