Solved

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

Posted on 2010-09-07
7
1,374 Views
Last Modified: 2012-06-21
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...
0
Comment
Question by:echoEMC2
7 Comments
 
LVL 10

Expert Comment

by:honestman31
Comment Utility
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
0
 
LVL 2

Accepted Solution

by:
Luigi2009 earned 500 total points
Comment Utility
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:
 http://learn.iis.net/page.aspx/465/url-rewrite-module-configuration-reference/
0
 
LVL 7

Expert Comment

by:Inteqam
Comment Utility
I use URLReWriter, it is easy and free

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

0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 

Author Comment

by:echoEMC2
Comment Utility
Hey guys, sorry I forgot to mention we are using asp.net mvc 2

Any suggestions since it's asp.net mvc 2?  Thanks.
0
 
LVL 7

Expert Comment

by:Inteqam
Comment Utility
0
 
LVL 7

Expert Comment

by:Inteqam
Comment Utility
below is a link talking about using routing instead of url rewriting
http://chriscavanagh.wordpress.com/2008/03/11/aspnet-routing-goodbye-url-rewriting/
0
 

Author Closing Comment

by:echoEMC2
Comment Utility
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.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now