Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用PHP参数重定向URL_Php_.htaccess_Redirect_Parameters - Fatal编程技术网

使用PHP参数重定向URL

使用PHP参数重定向URL,php,.htaccess,redirect,parameters,Php,.htaccess,Redirect,Parameters,我已经搜索并尝试了关于将带有PHP参数的URL重定向到没有PHP参数的URL的各种主题,但无法使其工作 我有以下网址: http://www.example.nl/?option=com_neorecruit&task=offer_view&id=82&Itemid=9 只需将其重定向到 http://www.example.nl/ 到目前为止,我找到的代码片段将我引向了这一点,我在.htaccess中添加了这一点: RewriteCond %{QUERY_STRIN

我已经搜索并尝试了关于将带有PHP参数的URL重定向到没有PHP参数的URL的各种主题,但无法使其工作

我有以下网址:

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]
但我不能让它正常工作。有人能帮我解决问题或给我指出正确的方向吗?

像这样试试

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

谢谢,但不幸的是,这没有什么区别。请尝试在字符串中使用\before&like
\&