将旧站点页面重定向到dnn门户上的单个页面 [英] redirecting old site pages to single page on dnn portal

查看:91
本文介绍了将旧站点页面重定向到dnn门户上的单个页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在使用DNN社区版。在旧站点中有一堆html,aspx页面应该(但不是全部)重定向到新的DNN门户v7.1(301重定向)中的单个(默认)页面。下面是一个示例:

We are using Community Edition of DNN. There is old site with bunch of html, aspx pages that should (not all of them though) redirect to single (default) page in new DNN portal v7.1 (301 redirect). Here is an example:


  • www.mysite.com/hello.html-> www.mysite.com

  • www.mysite.com/mypath/hello.html->与上述相同

  • 与.aspx页面相同->与上述相同

  • www.mysite.com/mypath->与上述相同

  • www.mysite.com/hello.html -> www.mysite.com
  • www.mysite.com/mypath/hello.html -> same as above
  • the same with.aspx pages -> same as above
  • www.mysite.com/mypath -> same as above

是否可以使用DNN CE的功能来实现目标还是ASP.NET本身?到目前为止,只有两件事浮现在脑海:

Is it possible to implement the goal using features of DNN CE or ASP.NET itself? So far only two things are coming on top of my head:


  1. web.config中的httpRedirect-但这仅涵盖了。 html部分,并且仅是因为新站点未使用任何类似的文件

  1. httpRedirect in web.config - but that will only cover .html part, and only because new site is not using any files like that

友好的url(对siteulrs.config进行了更改)-适用于任何有问题的方案但是,尽管重定向客户进入首页后,浏览器的网址栏仍显示旧网址(从301 SEO角度来看,我不确定这样做的效果如何)

friendly urls (making chages to siteulrs.config) - works for any scenarios in question but though after redirect customer is landed on home page, browser's url bar keeps showing old url (and I'm not sure how good is that from 301 SEO perspective)

谢谢!

推荐答案

我想不出如何在DNN中做到这一点,但您可以使用 IIS URL重写

I can't think of how to do this in DNN, but you could use IIS URL Rewrite

使用URL重写,您可以通过IIS定义各种规则,这些规则将告诉IIS何时重定向请求。您可以使用正则表达式或通配符定义规则,并将其写入web.config。

Using URL Rewrite, you can define all sort of rules, via IIS, that will tell IIS when to Redirect a request. You can use Regular Expressions or Wildcards to define the rules, which get written into the web.config.

类似

Something like:

Rule 1: Request to www.mysite.com/hello.html -> Redirect to www.mysite.com
Rule 2: Request to www.mysite.com/mypath/* -> Redirect to www.mysite.com/{0}

这篇关于将旧站点页面重定向到dnn门户上的单个页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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