【问题标题】:htaccess redirect: "example.com/?deletethis" to "example.com"htaccess 重定向:“example.com/?deletethis”到“example.com”
【发布时间】:2014-03-24 04:11:36
【问题描述】:

我正在尝试重定向(使用 .htaccess 文件): http://www.example.com/?deletethis 至: http://example.com

我试试这个: 重写引擎开启

RewriteCond %{QUERY_STRING} deletethis [NC]
RewriteRule . http://example.com/? [R=301,L]

但是不行,我试试这个: 重写引擎开启

Redirect 301 /?deletethis http://example.com

但也不行。

【问题讨论】:

    标签: .htaccess url-redirection


    【解决方案1】:

    试试这个:

    RewriteEngine On
    RewriteBase /
    RewriteCond %{QUERY_STRING} deletethis [NC]
    RewriteRule ^ http://example.com/? [R=301,L]
    

    将. 替换为^

    【讨论】:

    • 非常感谢您的帮助。你的解决方案不是很容易。我工作了几个小时!!
    猜你喜欢
    • 2011-12-13
    • 2014-10-17
    • 2014-09-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-07-05
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多