views:

33

answers:

1

I'm trying to remove unwanted additional forward slashes in my URLs. For example:

"http://www.domain.com//" and "http://www.domain.com///"

should redirect to:

"http://www.domain.com"

I'm using the IIS URL rewrite module. Here is what I have so far:

<rule name="RedirectForwardSlash" stopProcessing="true">
      <match url="//+$" />
      <action type="Redirect" url="default.aspx" appendQueryString="true" redirectType="Permanent" />
</rule>
A: 
  1. Why remove additional slashes if they are technically correct?
  2. How are the multiple slashes even occurring in the first place?
  3. What is wrong with your current code? Are there any errors?
Delan Azabani
Someone created a SEO report for our website. They highlighted a few canonical issues. They believe multiple forward slashes will dilute the search results. The forward slashes are added by the user. Does this make sense? Is this a real canonical issue?
Junior Developer
Personally, from my experience I've never seen a search engine index multiple-slashes in a URI as a separate item. It all seems to map to one item, so I don't think that users using multiple slashes is a problem.
Delan Azabani