![]() |
SEO urls and forwarding from old site |
Post Reply ![]() |
Author | |
BrianRoden ![]() Groupie ![]() Joined: 07-September-2007 Status: Offline Points: 0 |
![]() ![]() ![]() ![]() ![]() Posted: 24-June-2010 at 12:32pm |
We recently launched a ProductCart site to replace the product details of our company site. The main site with general company info, video webscasts, free patterns, etc. is at www.leisurearts.com. The ProductCart site is shop.leisurearts.com.
I rewrote the Page_Load routine for the item detail page on the other site so that it takes the item number that is passed in our previous SEO-friendly URLs, looks it up from the SKU field in the Products table, then builds a new URL to the ProuctCart SEO-friendly URL for that item and does a 301 redirect. Where I'm running into trouble is with item names/titles that have special characters in them, like the trademark symbol ™, the registered trademark symbol ®, and smart apostrophes/single right quotes ’ . I wrote my own VB function in our .net site:
TitleForURLUse = inputURL
TitleForURLUse = TitleForURLUse.Replace(Chr(34), "") TitleForURLUse = TitleForURLUse.Replace(":", "") TitleForURLUse = TitleForURLUse.Replace("'", "") TitleForURLUse = TitleForURLUse.Replace(" ", "-") TitleForURLUse = TitleForURLUse.Replace("&", "and") TitleForURLUse = TitleForURLUse.Replace(",", "") TitleForURLUse = TitleForURLUse.Replace("/", "") TitleForURLUse = TitleForURLUse.Replace("+", "") TitleForURLUse = TitleForURLUse.Replace(".", "") TitleForURLUse = TitleForURLUse.Replace("!", "") TitleForURLUse = TitleForURLUse.Replace(Chr(13), "") TitleForURLUse = TitleForURLUse.Replace(Chr(10), "") which obviously isn't covering those special charcters, and so on those items with these odd characters in the title, I'm not generating the same SEO-friendly URL as ProductCart, and the redirect is failing because PC can't find the item.
Can someone point me to the code in ProductCart that is used for making the SEO-friendly URLs, so I can make sure I cover the same characters and redirect to a correctly-formed URL?
|
|
![]() |
|
Matt ![]() Moderator Group ![]() Joined: 20-July-2006 Location: United States Status: Offline Points: 73 |
![]() ![]() ![]() ![]() ![]() |
Try "pc/pcSeoFunctions.asp"
|
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |