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

url mappings with or without trailing slash

I use UrlMappings in web.config. Now, I must have 2 url entries to make the mapping work with both the trailing backslash and without. Like this:

      <clear />
      <add url="~/app" mappedUrl="~/Templates/Sections/Common/Article.aspx?id=981" />
      <add url="~/app/" mappedUrl="~/Templates/Sections/Common/Article.aspx?id=981" />

Open in new window

Is it possible to make the url (~/app) work with or without trailing slash, in one line of code? Mabye by using wildcard or something for the "~/app" url..?
1 Solution
Terry WoodsIT GuruCommented:
If it's a regular expression then you would use url="~/app/?"

However, I found this, which says to me it's not the default behaviour to allow regex's (the article says how to add support for regex's):
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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