我们网站的几个页面使用旧的非 SEO 友好 URL 编入索引,例如 http://www.domain.com/DocumentDetails.aspx?id=555.最近我们实现了使用存储在数据库中的 slug 的路由,并使用路由查找 slug 将您转发到正确的页面,例如:http://www.domain.com/Documents/Title-of-the-Document
We have several pages of our site indexed using old non-SEO friendly URLS such as http://www.domain.com/DocumentDetails.aspx?id=555. Recently we implemented routing that uses slugs stored in the database and looks up the slug to forward you to the right page using routing, for example: http://www.domain.com/Documents/Title-of-the-Document
这一切都很好,但是我们很难找到最好的方法来为 Google 当前索引的所有链接设置 301 永久重定向.
This is all well and good however we are having a hard time finding the best way to set up our 301 permanent redirects for all the links currently indexed by Google.
有没有办法让一个集中的地方存储旧 URL 和新 URL,并让它在找到条目时自动执行 301 重定向,并将不同的查询字符串参数视为不同的条目?我们使用的是 IIS6 和 Server 2003.
Is there a way to have 1 centralized place to store old URL and new URL, and have it do the 301 redirect automatically when it finds an entry, and also treat different query string parameters as different entries? We are using IIS6 and Server 2003.
谢谢!
添加一个 CustomRouteHandler 用于您的旧页面,可以对您的新 URL 执行 301:
Add a CustomRouteHandler for your old page that can do the 301 to your new URL:
//look up new url and do the 301
Response.Status = "301 Moved Permanently";
Response.AddHeader("Location","http://www.example.com/");
这篇关于ASP.NET 中的 Mass 301 重定向,包括需要根据查询字符串参数重定向到不同位置的页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
ASP.NET Core 使用 Azure Active Directory 进行身份验证并ASP.NET Core authenticating with Azure Active Directory and persisting custom Claims across requests(ASP.NET Core 使用 Azure Active Directory 进行身
ASP.NET Core 2.0 Web API Azure Ad v2 令牌授权不起作用ASP.NET Core 2.0 Web API Azure Ad v2 Token Authorization not working(ASP.NET Core 2.0 Web API Azure Ad v2 令牌授权不起作用)
ASP Core Azure Active Directory 登录使用角色ASP Core Azure Active Directory Login use roles(ASP Core Azure Active Directory 登录使用角色)
如何获取守护进程或服务器到 C# ASP.NET Web API 的How do I get Azure AD OAuth2 Access Token and Refresh token for Daemon or Server to C# ASP.NET Web API(如何获取守护进程或服务器到 C# ASP.N
.Net Core 2.0 - 获取 AAD 访问令牌以与 Microsoft Graph.Net Core 2.0 - Get AAD access token to use with Microsoft Graph(.Net Core 2.0 - 获取 AAD 访问令牌以与 Microsoft Graph 一起使用)
异步调用时 Azure KeyVault Active Directory AcquireTokenAAzure KeyVault Active Directory AcquireTokenAsync timeout when called asynchronously(异步调用时 Azure KeyVault Active Directory AcquireTokenAsync 超