PDA

View Full Version : Vanity URL isn't working


TitaniumMom
Nov-09-2006, 02:45 PM
Hi guys! For some reason the vanity URL isn't working...can anyone puzzle out what I have done? The site is froggy.smugmug.com
Thanks!

Andy
Nov-09-2006, 02:56 PM
Hi guys! For some reason the vanity URL isn't working...can anyone puzzle out what I have done? The site is froggy.smugmug.com
Thanks!
What vanity url please? We need much more specifics in order to be able to help you :D

TitaniumMom
Nov-09-2006, 03:06 PM
haha, well, all of them actually. Here is the code I used:
I put this in my header:
<script type="text/javascript" language="javascript">
CheckRedirects();
</script>
I put this in the javascript section first:
var vanityTable =
{
biancasblankets : "http://froggy.smugmug.com/gallery/1937779",
guestbook : "http://froggy.smugmug.com/gallery/2112508",
contact: "http://froggy.smugmug.com/gallery/2112556"
};

Then this code after it:
function IsHomePage()
{
return(YD.hasClass(document.body, 'homepage'));
}

function CheckRedirects()
{
if (IsHomePage()) // only run this code on the home page
{
// get the path from the current URL,
// convert it to lowercase and remove the leading slash
var path = window.location.pathname.toLowerCase().substr(1);

var newURL = vanityTable[path]; // look it up in our table

// if we found it in the table && newURL is different than where we are
if (newURL && (newURL != window.location))
{
window.location.replace(newURL); // go to the new URL
}
}
}


Is this right?
Thanks!

BeachBill
Nov-09-2006, 04:30 PM
http://froggy.smugmug.com/biancasblankets
http://froggy.smugmug.com/guestbook
http://froggy.smugmug.com/contact


They all work for me.

Andy
Nov-09-2006, 05:15 PM
They all work for me.
Me too... :dunno