Welcome to WebmasterWorld Guest from

Forum Moderators: ocean10000

Message Too Old, No Replies

Hyphens turn to %2

11:41 am on Sep 28, 2006 (gmt 0)

New User

10+ Year Member

joined:June 4, 2004
votes: 0


I have a folder that looks like this: www.mysite.com/this-folder

When I browse to it I get www.mysite.com/this%2folder

Is this standard behaviour for sites in .NET

Can anything be done to prevent the change?



12:16 pm on Sept 28, 2006 (gmt 0)

Junior Member

10+ Year Member

joined:Aug 5, 2002
votes: 0

I've noticed the same thing on some sites. To prevent it, add a terminal / to the URL, like this:


That prevents the behavior you noticed on IIS. What I don't know is why this happens. Something in the IIS <-> ASP.NET interaction tries to encode the dash in a non-slash-terminated URL, but not if there is a terminating slash. It may have something to do with IIS not having to redirect a slash-terminated URL.