Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/apache/9.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/5.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
Apache Htaccess重定向-当我的查询字符串等于-this-is-test1时,我想重定向到URL_Apache_.htaccess_Redirect_Mod Rewrite_Url Rewriting - Fatal编程技术网

Apache Htaccess重定向-当我的查询字符串等于-this-is-test1时,我想重定向到URL

Apache Htaccess重定向-当我的查询字符串等于-this-is-test1时,我想重定向到URL,apache,.htaccess,redirect,mod-rewrite,url-rewriting,Apache,.htaccess,Redirect,Mod Rewrite,Url Rewriting,当我的查询字符串等于-this-is-test1 Redirect /search/product/basecamp?-this-is-test1 https://www.some-example.com/search/product/result-this-is-test1 注意:查询字符串中只有一个值没有任何键。请尝试以下操作,确保在将这些规则放入yout.htaccess文件后清除浏览器缓存 RewriteEngine On RewriteCond %{THE_REQUEST} \s/

当我的查询字符串等于
-this-is-test1

Redirect /search/product/basecamp?-this-is-test1 https://www.some-example.com/search/product/result-this-is-test1

注意:查询字符串中只有一个值没有任何键。

请尝试以下操作,确保在将这些规则放入yout.htaccess文件后清除浏览器缓存

RewriteEngine On
RewriteCond %{THE_REQUEST}  \s/(search/product)/basecamp\?(-this-is-test1)\s [NC]
RewriteRule ^(.*)$ /%1/result%2? [NE,L,R=301]

请尝试以下操作,确保在将这些规则放入yout.htaccess文件后清除浏览器缓存

RewriteEngine On
RewriteCond %{THE_REQUEST}  \s/(search/product)/basecamp\?(-this-is-test1)\s [NC]
RewriteRule ^(.*)$ /%1/result%2? [NE,L,R=301]

无法匹配
重定向
重定向匹配
指令中的查询字符串。 您可以根据
mod_rewrite
模块使用此规则:

RewriteEngine On

RewriteCond %{QUERY_STRING} (-this-is-test1) [NC]
RewriteRule ^(search/product)/basecamp/?$ /$1/result%1? [NE,L,R=301,NC]
目标末尾的
将删除任何查询字符串

参考文献:


您无法匹配
重定向
重定向匹配
指令中的查询字符串。 您可以根据
mod_rewrite
模块使用此规则:

RewriteEngine On

RewriteCond %{QUERY_STRING} (-this-is-test1) [NC]
RewriteRule ^(search/product)/basecamp/?$ /$1/result%1? [NE,L,R=301,NC]
目标末尾的
将删除任何查询字符串

参考文献:


您好,请在各自的答案中告诉我们解决方案的进展情况,谢谢。您好,请在各自的答案中告诉我们解决方案的进展情况,谢谢。