发布新网站时处理重定向

编程入门 行业动态 更新时间:2024-10-10 07:31:10
本文介绍了发布新网站时处理重定向的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我即将为客户发布/替换站点.我想知道处理从旧的(不再存在的)页面到新的等效页面(不同的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/product/page.aspx应该重定向到site/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. learn.iis/page. aspx/460/using-the-url-rewrite-module/

If you are looking for a module then have a look at the below url. learn.iis/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.

希望有帮助.

更多推荐

发布新网站时处理重定向

本文发布于:2023-10-12 05:11:23,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1483808.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:重定向   网站

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!