Safari Adds Trailing Slash

怎甘沉沦 提交于 2021-02-08 05:28:14

问题


I've got an ASP.NET website that uses URLRewrite 2 to remove trailing slashes from the URL.

We noticed that Safari on Mac does not obey this rule. It always leaves the trailing slash in the URL. SEO Moz is showing both URLs which appears to be a potential duplicate content issue.

Here is the URLRewrite rule in our Web.Config

<rule name="Remove trailing slash" stopProcessing="true">
    <match url="(.*)/$" />
    <conditions>
        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
    </conditions>
    <action type="Redirect" redirectType="Permanent" url="{R:1}" />
 </rule>

Here is the website in question: http://www.kurtzandblum.com/ (the slash will be removed except in Safari)

I'm trying to decide if...

  1. This is a harmless bug in Safari?
  2. My rewrite script is flawed.
  3. I should switch it to "add" trailing slashes.

Google says slash or no slash will work http://googlewebmastercentral.blogspot.com/2010/04/to-slash-or-not-to-slash.html

Thanks for any insight.


回答1:


It's just how Safari is handling URLs. There is no impact on SEO, so you don't need to do anything.

Your URLs are looking fine in Chrome.



来源:https://stackoverflow.com/questions/11348479/safari-adds-trailing-slash

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!