使用PHP参数重定向URL

时间:2016-09-14 07:10:23

标签: php .htaccess redirect parameters

我已经搜索并尝试了各种主题,将有关PHP参数的网址重定向到网址,但没有,但无法使其发挥作用。

我有以下网址:

http://www.example.nl/?option=com_neorecruit&task=offer_view&id=82&Itemid=9

需要将其重定向到

http://www.example.nl/

到目前为止我发现的片段引导我这个,我在.htaccess中添加了这个:

RewriteCond %{QUERY_STRING} option=com_neorecruit&task=offer_view&id=82&Itemid=9
RewriteRule ^(.*)$ http://www.example.nl/ [R=301,L]

但我无法让它正常运作。任何人都可以帮助我或指出我正确的方向吗?

1 个答案:

答案 0 :(得分:0)

尝试这样,

RewriteCond %{QUERY_STRING} ^option=com_neorecruit&task=offer_view&id=82&Itemid=9$
RewriteRule ^ http://www.example.nl/ [R=301,L]
相关问题