Link to home
Start Free TrialLog in
Avatar of echoEMC2
echoEMC2

asked on

adding a trailing slash in asp.net url - url rewrite

Hello, we're trying to add a trailing slash in a url of a website coded in asp.net IIS 7

right now the webpage is:

.com/leads.html

we want to change it to:

.com/leads/

the only thing we can do know w/ IIS rewrite is change it to:

.com/leads

do you have any suggestions?  Thanks for any help...
Avatar of honestman31
honestman31

create a folder named leads  under the root directory
move leads.html to be in the folder leads
rename leads.html    into index.html
point your browser to  .com/leads/

you are done
ASKER CERTIFIED SOLUTION
Avatar of Luigi2009
Luigi2009
Flag of Czechia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I use URLReWriter, it is easy and free

a rule as yours would be:
<rewrite url="~/Public/Thankyou" to="~/Public/Thankyou.aspx" processing="stop"/>

Avatar of echoEMC2

ASKER

Hey guys, sorry I forgot to mention we are using asp.net mvc 2

Any suggestions since it's asp.net mvc 2?  Thanks.
below is a link talking about using routing instead of url rewriting
http://chriscavanagh.wordpress.com/2008/03/11/aspnet-routing-goodbye-url-rewriting/
The solution was to use the url rewrite module for iis 7 as this url says: http://weblogs.asp.net/scottgu/archive/2010/04/20/tip-trick-fix-common-seo-problems-using-the-url-rewrite-extension.aspx

Then, you need to create a new helper instead of using the default Url.Route(), like a Url.RouteTrailingSlash() that adds a "/" at the end of the urls.