Go Premium for a chance to win a PS4. Enter to Win

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1562
  • Last Modified:

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:


we want to change it to:


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


do you have any suggestions?  Thanks for any help...
1 Solution
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
You have to create URL rewrite rule for IIS7 web site. It will automatically rewrite input url in format /leads/ to leads.html
First of all download and install rewrite module for IIS7 using web platform installer.
Then create new rewrite rules.

You can use rewriteMaps more information you can find here:
I use URLReWriter, it is easy and free

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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

echoEMC2Author Commented:
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
echoEMC2Author Commented:
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.

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now