从旧页面重定向到新页面 [英] Redirect from old pages to new pages
问题描述
我必须使用没有MVC的ASP.NET将一些旧页面重定向到新页面
旧页面url:abc.com/how-to-301-permanent -redirect-in-asp-net /
新页面网址:abc.com/blog/301-permanent-redirect-in-asp-net/
我想在重定向地图文件中管理旧网址和新网址,可能是csv或xml。
旧网站使用的是Wordpress CMS,对于新网站,我在Global.asax文件中使用简单路由
路由。 MapPageRoute(blog,blog / {blog_slug} /,〜/ blog_detail.aspx);
我尝试了什么:
我试过这段代码:在ASP.NET 3.5中处理301重定向 [ ^ ]
但如上所述在本教程中,它不适用于为seo创建的文件夹级页面。页数为250+,因此无法为每个页面放置默认文件和文件夹。任何更简单的方法来实现这一目标?任何人都可以帮我这么做吗?
在asp.net中进行301重定向 - Google搜索 [ ^ ]
在搜索结果中,我去了这里:< br $> b $ b
Jeff Widmer的博客 - 如何在ASP.NET中进行301永久重定向 [ ^ ]
第一个回复可能适用于您的情况,但只有您可以确定
I have to redirect some old pages to new page using ASP.NET without MVC
old page url: abc.com/how-to-301-permanent-redirect-in-asp-net/
new page url: abc.com/blog/301-permanent-redirect-in-asp-net/
I'd like to manage the old and new URLs in a redirect map file maybe a csv or xml.
The old website was using Wordpress CMS and for the new one I'm using simple Routing in Global.asax file
routes.MapPageRoute("blog", "blog/{blog_slug}/", "~/blog_detail.aspx");
What I have tried:
I have tried this code: Handling 301 Redirects in ASP.NET 3.5[^]
But as mentioned in the tutorial, it is not working for folder level pages created for seo. The number of pages are 250+ so it's not possible to put a default file and a folder for each of them. Any simpler way to achieve this? Can anyone help me in doing this?
301 redirects in asp.net - Google Search[^]
In that search result, I went here:
Jeff Widmer's Blog - How to 301 Permanent Redirect in ASP.NET[^]
The first response might be appropriate in your case, but only you can determine that.
这篇关于从旧页面重定向到新页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!