asp.net - .net 将旧的规范 url 重定向到新的 url 格式
问题描述
所以最近一位客户决定测试一个不同的规范网址,看看他们在搜索引擎上的位置是否发生了变化。当前的规范网址如下www.mydomain.com/{article-id}
,他们只想将 10 篇左右的文章更改为www.mydomain.com/{article-id}/{friendly-url}
.
例子:www.mydomain.com/123456 -> www.mydomain.com/123456/the-gratest-article-ever
正如我所说,他们只想更改几篇文章,看看排名是否会发生变化。
为了正确测试排名是否增加,我必须创建一个从旧网址到新网址的永久重定向。
我曾尝试使用 httpRedirect 在 Web 配置中进行重定向,如下所示:
<location path="123456">
<system.webServer>
<httpRedirect enabled="true" destination="/123456/the-gratest-article-ever" httpResponseStatus="Permanent" />
</system.webServer>
</location>
但这不起作用,因为它不断添加 /the-gratest-article-ever 一个又一个,整个事情都失败了The length of the URL for this request exceeds the configured maxUrlLength value.
是否可以使用网络配置来实现这一点?
谢谢,乙
解决方案
推荐阅读
- java - 值更改侦听器未触发
- javascript - R:Shiny.OnInputChange 实时点击
- sql-server - CASE WHEN 限制返回 SQL Server 2008 的行
- jhipster - JHipster - 产品构建工作不正常
- neo4j - 检索图表使用的标签
- r - 有没有办法预测 R 中的未来生存概率?
- azure-active-directory - 使用 Azure 机器人服务对 OAuth 进行身份验证时出现问题
- python - 在python中用字典而不是多个字典创建列表
- sql - SQL 使用 COUNT(*) 设置列的值
- excel - VBA listobject查找功能快速