帮助 Plesk 服务器(特别是 eUk 主机)上的 301 重定向
我在这里兜圈子,不知道是否有人可以帮忙。
我最近将一个静态 html 网站移至 Umbraco。它在 Windows plesk 共享计划上运行。
我需要将旧内容的 301 重定向设置为新内容,但是:
- Umbraco 不会收到对 .html 的请求,似乎没有办法做到这一点。
- 我无法在 plesk 支持作为自定义错误文档的 .html 文件中运行任何服务器端。
我打算使用客户端元重定向,但不确定 Google 等是否会正确读取这些内容?
I am running around in circles here, I wonder if anyone can help.
I recently moved a static html website to Umbraco. It is running on a Windows plesk shared plan.
I need to put in place 301 redirects for the old content to the new but:
- Umbraco won't receive requests for.html, there doesn't appear to be a way to do this.
- I can't get any server side running in the .html files that the plesk supports as custom error docs.
I was going to use client side meta redirects, but wasn't sure if Google etc will read these right?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我自己没有使用过,但 Umbraco 301 已永久移动项目看起来它可以满足您的需要。
真正的技巧是通过 ASP.Net 管道传输对 .html 文件的所有请求。我不确定您的网络托管服务商是否可以完成此操作。但可以在这里找到一些提示:
http://our.umbraco.org/projects/developer-tools/301-moved-permanently/feedback/7271-when-the-old-pages-are-not-from-umbraco
ps你客户端重定向无助于 SEO 是正确的。
I haven't used it myself, but the Umbraco 301 Moved Permanently project looks like it does what you need.
The real trick will be piping all requests for .html files through ASP.Net. I'm not sure if this can be done with your web host. But some tips can be found here:
http://our.umbraco.org/projects/developer-tools/301-moved-permanently/feedback/7271-when-the-old-pages-are-not-from-umbraco
p.s. You are correct that a client-side redirect will not help with SEO.
您可以在
UrlRewriting.config
中添加一条规则,该文件位于 Umbraco 安装中...“~config/UrlRewriting.config”该规则将从页面请求中去除 .html 扩展名。并且看起来像下面这样......
<代码>
您还必须确保
web.config
文件将以下键设置为 true这将允许您使用 umbraco cms 内的节点重新创建 url 结构,而无需 html 或 aspx 扩展名。如果这一切看起来太复杂,您可以单独将要侦听的每个页面添加到 URL Alias 属性 (umbracoUrlAlias) 中的相应节点。 Umbraco 将接受此信息并重定向到您的页面。
you could add a rule in to your
UrlRewriting.config
the file sits here in the Umbraco installation... "~config/UrlRewriting.config"The rule would strip the .html extension from the page request. And would look something like the following...
You would also have to make sure that the
web.config
file had the following key set to true<add key="umbracoUseDirectoryUrls" value="true"/>
This would allow you to recreate your url structure with nodes inside the umbraco cms without the html or aspx extension. If all this seems too complex you could individually add each page you want to listen for to the corresponding node in the URL Alias property (umbracoUrlAlias). Umbraco will take this and redirect to your page.