1.11M Members

URL Rewrite 2.0 - replacing spaces with hyphens in URLs

 
0
 

Is it best (or even possible) to replace spaces using URL Rewrite or using ASP/ASP.net before the URL is sent? If it's the former, can it be done with a wizard within IIS? Also, I will need to replace capital letters and accented characters with an equivalent e.g. é with e, is this best done with URL Rewrite?

I've tried some of the tutorials on the official IIS website and have got through a simple rewrite wizard, but replacing characters seems more complicated, and I'm sure some of the tutorials have errors in them...

Thanks for any help. :)

 
0
 

I can't remember the specific namespace, but .NET has a built in URLEncode, and URLDecode functions that take a string and make it compliant with standard URLs

 
0
 

Thanks, though I don't think that's what I need as it changes spaces to pluses and non-standard characters to a % and hexadecimal value.

 
0
 

Alright, I'm guessing you aren't going to be using the string in an URL then.

 
0
 

The URL I want will be something like this: www.webaddress.com/150211/title-of-news-article instead of www.webaddress.com/article.asp?date=150211&title=title-of-news-article

You
This article has been dead for over six months: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: