Results 1 to 4 of 4
August 19th, 2006, 06:12 PM #1Question about URLencoding to my fellow ASP.NET programmers
I am working in ASP.NET/C# to build a google sitemap from my product info. I am trying to get my product URLs encodeded correctly to imbed in a google sitemap XML file OK so Google can crawl correctly.
ASP.NET has two methods for this and neither seem to give me exactly what I need.
HTTPUtility.Urlencode() produces URLs like:
Server.HTMLencode() produces URLs like (different product):
<loc>http://www.mydomain.com/pr-454395653-Talbott Chardonnay "Sleepy Hollow".aspx</loc>
How have you solved this issue?
August 26th, 2006, 08:32 AM #2
Hmm... Personally, I would suggest not using "'s in your URL, and I would replace the spaces with - or _
You could create function to replace any bad URL chars.
August 26th, 2006, 01:19 PM #3
Offerfind is ON THE MONEY! You must ditch the " and spaces. Once done, you're xml sitemap issue will be solved, along with many others.
ASP folks do dynamic page renaming (mod rewriting) using either "IIS Rewrite" or "ISAPI_Rewrite". They're both good, but I think the ISAPI one is better for several unimportant reasons. Pick one and go with it.
ISAPI is here: http://www.isapirewrite.com/
August 26th, 2006, 04:08 PM #4
Thanks all. I solved this right after I posted it and should have posted back. Like he said I ended up writing my own routine to take care of it.
I also ended up with a way to do the mod_rewrite functionality without any IIS or ISAPI modifications. It is all internal to ASP.NET and my code which I like.
By Murray Newlands in forum Job PostingsReplies: 0Last Post: July 24th, 2007, 05:23 AM
By PatrickAllmond in forum Programming / Datafeeds / ToolsReplies: 9Last Post: October 5th, 2005, 09:38 AM
By stfarm45 in forum Programming / Datafeeds / ToolsReplies: 0Last Post: March 2nd, 2005, 10:44 PM
By Packy in forum Programming / Datafeeds / ToolsReplies: 2Last Post: April 4th, 2004, 11:31 PM