发布新网站时处理重定向 [英] Dealing with redirects when releasing new site

查看:62
本文介绍了发布新网站时处理重定向的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我即将为客户发布/替换站点.我想知道处理从旧的(不再存在的)页面到新的等效页面(不同的URL)的重定向的最佳方法是什么.

I am on the verge of releasing/replacing a site for a client. I am wondering what the best way of dealing with redirects from old (no longer existing) pages to the new equivalent page (differnt url).

示例:

site.com/product/page.aspx应该重定向到site.com/newstructure/stuff.aspx

我正在寻找一种可靠的集中方式来处理所有这些重定向(301:s).

I'm looking for a solid central way of handling all these redirects (301:s).

为旧页面创建路径并仅从那里进行重定向并不是一个很好的解决方案.我可以在Web.config中使用网址映射吗?我应该使用global.asax吗?

Creating paths for old pages and simply redirects from there is not really a good solution. Can I use Url Mappings in Web.config for this? Should I use global.asax?

推荐答案

我建议使用URL重写模块,然后设置规则.您的网址可能不匹配,因此您必须手动映射它们(无论如何,最好手动进行映射,因为这是最可靠的方法).

I would suggest using URL Rewrite module and then setting up the rules. Your urls probably won't match, so you would have to map them manually (anyways it's much better to do it manually as this is the most reliable way).

如果您正在寻找一个模块,那么请看下面的URL. http://learn.iis.net/page. aspx/460/using-the-url-rewrite-module/

If you are looking for a module then have a look at the below url. http://learn.iis.net/page.aspx/460/using-the-url-rewrite-module/

根据要在哪个IIS下运行它,您可能需要查找不同版本的重写模块.

Depending on which IIS you are running it under, you might want to find different version of the rewrite module.

希望有帮助.

这篇关于发布新网站时处理重定向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆