Jump to content

one site two domains

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 post
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 post
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 post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...