【问题标题】:Redirect that starts with a?以a开头的重定向?
【发布时间】:2013-10-16 15:25:38
【问题描述】:

我需要重定向到我拥有的一个 404 错误的站点。 重定向在 Joomla 的 .htaccess 文件中完成。这是我目前拥有的:

redirect 301 /?view=category&id=12:bestfriend&Itemid=946&start=20 http://www.mysite.com

但它不会重定向,因为它以“?”开头。 有任何想法吗?我有很多这样的东西 - 不仅仅是一个。

【问题讨论】:

    标签: regex apache .htaccess mod-rewrite joomla2.5


    【解决方案1】:

    您无法使用Redirect 指令匹配查询字符串。像这样使用 mod_rewrite:

    RewriteEngine On
    
    RewriteCond %{QUERY_STRING} ^view=category&id=12:bestfriend&Itemid=946&start=20 [NC]
    RewriteRule ^ http://www.mysite.com/? [R=301,L]
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-10-09
      • 2019-01-29
      • 2017-11-19
      • 2018-11-15
      • 1970-01-01
      • 1970-01-01
      • 2015-08-09
      相关资源
      最近更新 更多