We're a community of 1076K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,075,756 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

URL Rewrite 2.0 - replacing spaces with hyphens in URLs

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. :)

3
Contributors
5
Replies
1 Day
Discussion Span
2 Years Ago
Last Updated
6
Views
TheAlex
Junior Poster in Training
67 posts since Feb 2005
Reputation Points: 12
Solved Threads: 2
Skill Endorsements: 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

Fortinbra
Posting Whiz in Training
240 posts since Jan 2011
Reputation Points: 47
Solved Threads: 12
Skill Endorsements: 1

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.

TheAlex
Junior Poster in Training
67 posts since Feb 2005
Reputation Points: 12
Solved Threads: 2
Skill Endorsements: 0

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

Fortinbra
Posting Whiz in Training
240 posts since Jan 2011
Reputation Points: 47
Solved Threads: 12
Skill Endorsements: 1

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

TheAlex
Junior Poster in Training
67 posts since Feb 2005
Reputation Points: 12
Solved Threads: 2
Skill Endorsements: 0

you might try this http://www.4guysfromrolla.com/articles/012710-1.aspx this is specific to .NET 4, but the feature exists in the older versions

Fortinbra
Posting Whiz in Training
240 posts since Jan 2011
Reputation Points: 47
Solved Threads: 12
Skill Endorsements: 1

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page rendered in 0.0715 seconds using 2.68MB