【问题标题】:need to redirect multiple urls through htaccess需要通过htaccess重定向多个url
【发布时间】:2016-06-11 13:09:44
【问题描述】:

我正在更新 wordpress 安装并永久更改网址。对于帖子,在 htaccess 中进行简单的重定向就可以了,但是有一个日历模块,事件重复,我不知道如何在 htaccess 中处理。

我需要离开

http://www.gamekeeper.ca/blog/ai1ec_event/dimanche-yu-gi-oh/?instance_id=61243

http://www.gamekeeper.ca/ai1ec_event/dimanche-yu-gi-oh/?instance_id=61243

所有事件。

我应该如何进行全局重定向?

感谢您的帮助!

【问题讨论】:

    标签: wordpress .htaccess url redirect url-redirection


    【解决方案1】:

    使用 RedirectMatch 指令如下:

    RedirectMatch 301 ^/blog/ai1ec_event/(.*) http://www.gamekeeper.ca/ai1ec_event/$1
    

    请注意,状态码 301 使其成为永久重定向,即它将被代理和浏览器缓存。您可能希望使用 302(临时重定向),直到您确定一切都按预期工作。

    更多信息请访问:http://httpd.apache.org/docs/2.2/mod/mod_alias.html#RedirectMatch

    【讨论】:

      猜你喜欢
      • 2021-04-02
      • 1970-01-01
      • 2017-02-04
      • 2013-04-17
      • 2014-01-16
      • 1970-01-01
      • 2023-03-06
      • 1970-01-01
      相关资源
      最近更新 更多