【问题标题】:.htaccess redirect based on a certain url param that redirects to another site.htaccess 重定向基于重定向到另一个站点的某个 url 参数
【发布时间】:2017-03-13 21:25:38
【问题描述】:

我正在尝试基于某个 url 参数设置 .htaccess 重定向,然后重定向到另一个站点。

例子:

原始网址:www.domain.com/?param=true

重定向网址:www.newdomain.com

我尝试了许多不同的方法,但似乎没有任何效果。

【问题讨论】:

    标签: .htaccess redirect parameters


    【解决方案1】:

    这个规则应该在www.domain.com的站点根目录.htaccess 中起作用:

    RewriteEngine On
    
    RewriteCond %{THE_REQUEST} \?param=true[&\s]
    RewriteRule ^ http://newdomain.com/? [L,R=301]
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-05-21
      • 1970-01-01
      • 1970-01-01
      • 2011-09-30
      • 1970-01-01
      • 2019-11-14
      相关资源
      最近更新 更多