2

I have an MVC project that needed to have the URL structure changed. I've modified the Global.asax.cs file so that all the URL's are now reflecting what the account team wanted. Long story short, there is a requirement to have a tailing '/' on all of the URL's (i.e. www.google.com/whatever/ ).

I think the best way to do this is to override the Html.ActionLink() function so all the URL's are generated the desired way but I'm not sure where/how to do this.

Thnx for any help

Daniel A. White
  • 187,200
  • 47
  • 362
  • 445
Adrian
  • 23
  • 3
  • possible duplicate of [How to get a trailing slash appended to page routes?](http://stackoverflow.com/questions/4157273/how-to-get-a-trailing-slash-appended-to-page-routes) – Daniel A. White Mar 02 '11 at 01:29

1 Answers1

3

Check this other StackOverflow question:

Why is ASP.NET MVC ignoring my trailing slash?

Quoting the approved answer:

Legenden - there is no immediate solution to the problem. You may have run across Jason Young's blog post about the issue, which is very informative. Scott Hanselmann posted a reply to it here, basically stating that he didn't think it was a big deal, and if it is, you can leverage the new IIS7 rewrite module to solve it.

Ultimately though, you might want to look at a solution that was posted by murad on a similar question on StackOverflow: Trailing slash on an ASP.NET MVC route

.

Another approach:

Community
  • 1
  • 1
Meligy
  • 35,654
  • 11
  • 85
  • 109