【发布时间】:2014-05-27 18:42:24
【问题描述】:
我正在将网站从一个平台移动到另一个平台,并且需要在新平台上使用模式匹配来重定向站点范围的 URL。
旧网址如下所示:
domain.com/really-super-neat-small-red-widget.hwp
domain.com/really-super-neat-big-red-widget.hwp
domain.com/really-super-neat-very-small-red-widget.hwp
他们需要被重定向到这样的网址:
domain.com/super/small-red-widget.html
domain.com/super/big-red-widget.html
domain.com/super/very-small-red-widget.html
所以旧网址上的模式匹配将是“really-super-neat-”“term”.dwf 扩展名
“really-super quiet”应该是新 url 中的“super”路径,后跟术语和 .html 扩展名。
有什么想法吗?
【问题讨论】:
-
你自己试过什么?你认为我们该怎么做?
标签: regex apache .htaccess mod-rewrite redirect