跳转到主要内容

plone.app.redirector的regex重定向插件

项目描述

简介

collective.regexredirector扩展了plone.app.redirector的行为,允许使用正则表达式定义重定向。

如果您正在迁移旧网站并将旧URL映射到新站点结构,这可能特别有用。

注意:当发生404错误时,collective.regexredirector首先调用plone.app.redirector,如果它没有重定向,则collective.regexredirector尝试匹配其注册的正则表达式之一。

用法

在Plone控制面板中,转到“RegexRedirector”控制面板并输入您的重定向规则。

每行一个重定向,格式如下

'old_url'='new_url'
'old_url2'='new_url2'

示例

将所有类似/news/something的URL重定向到/archives/index

'/news/.*'='/archives/index'

将所有类似/tags/something的URL重定向到/category/something

'/tags/(?P<category_name>.+)'='/category/\g<category_name>/view'

安装

将collective.regexredirector添加到您的buildout eggs中。

致谢

公司

makinacom

作者

变更日志

0.2.3 (2015-05-26)

  • 修复无匹配时的错误

0.2.2 (2015-05-12)

  • 支持重定向到包含查询字符串的URL

  • 修复规则中包含‘=’时的错误

0.2.1 (2013-03-28)

  • 修复egg(缺少/docs)

0.2 (2013-03-28)

  • 修复egg(缺少README.rst)

0.1 (2013-01-30)

  • 首次发布

由以下支持

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF 赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误记录 StatusPage StatusPage 状态页面