iis - 301 重写规则导致 SEO 警报

标签 iis https seo url-redirection http-status-code-301

我使用以下 rewrtie 规则强制访问者在我的网站中使用 HTTPS。 SEO 检查工具将此重定向标记为负 SEO 参数。我应该如何设置 200 状态代码以重定向到 HTTPS 或者有其他方式而不是重定向?

            <rule name="HTTPS" enabled="true" patternSyntax="Wildcard" stopProcessing="true">
                <match url="*" negate="false" />
                <conditions logicalGrouping="MatchAll">
                    <add input="{HTTPS}" pattern="off" />
                    <add input="{HTTP_HOST}" pattern="localhost" negate="true" />
                </conditions>
                <action type="Redirect" url="https://www.example.com/{R:0}" redirectType="Permanent" />
            </rule>

这是来自 sitechecker.pro 的示例报告:

Page status code: 301 > 200

The content and destination URL should deliver the desired experience when clicked. Web crawlers can block pages that use redirects.

We recommend you promote a page with the 200 status code.

最佳答案

我没有发现您的重写有任何问题。您的“seo 工具”返回的响应似乎表明您要求它扫描 http://example.com?如果是这种情况,那是一个合理/预期的结果(并且不是问题,因为 http 不是您网站的首选 url)。如果您使用 HTTPS 网址 https://example.com 我希望您的网站会返回 200 OK 响应 - 这应该满足您的 seo 工具?

从 http 重定向到 https 或以其他方式强制执行单个规范 url(即有或没有 www/全部小写等)是一个很好的 seo 实践。

重定向对您的主要 url https://example.com 上的 seo 不利,因为它们会导致额外的请求,从而延迟页面加载(例如,从 https://example.com 重定向/https://example.com/home 应该避免)爬虫在某些情况下可能不喜欢重定向,因为它们可以用于“黑帽”seo 实践。

关于iis - 301 重写规则导致 SEO 警报,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51222122/

相关文章:

c# - 如何在数据库中保存图像 URL?

windows - 如何通过代码安装 IIS 8

c# - 当您可以保护服务器 (IIS) 时,为什么还要使用 HTTPS 保护网站?

.htaccess - 在没有 SSL 的情况下为子域强制 http

node.js - 如何为 HTTPS Node.js 服务器使用自签名证书?

iphone - 这个计划是为了防止iPhone应用程序客户端欺骗声音吗?

regexp + modrewrite 就可以了

asp.net-mvc - 哪些可能导致 "Service Unavailable 503"错误?

seo - HTML 中的安全隐藏文本?

php - ci : google indexing address with index. php 但站点中没有与 index.php 的链接