Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/sharepoint/4.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
在NGINX中执行301重定向时跳过参数_Nginx_Http Status Code 301 - Fatal编程技术网

在NGINX中执行301重定向时跳过参数

在NGINX中执行301重定向时跳过参数,nginx,http-status-code-301,Nginx,Http Status Code 301,第一个帖子在这里。 所以我使用这段代码将特定页面从一个域重定向到另一个域 如果$request_filename ~/{rewrite^https://example.net 永久;} 有没有跳过代码中包含?d=的任何内容的选项? 我不希望重定向中包含?d=之后的任何页面。如果重写的URL以?结尾,则“重写”不会复制任何原始参数 例如: rewrite ^ https://example.net/? permanent; 有关详细信息,请参阅 或者,使用更简单的返回表达式: return 30

第一个帖子在这里。 所以我使用这段代码将特定页面从一个域重定向到另一个域

如果$request_filename ~/{rewrite^https://example.net 永久;}

有没有跳过代码中包含?d=的任何内容的选项?
我不希望重定向中包含?d=之后的任何页面。

如果重写的URL以?结尾,则“重写”不会复制任何原始参数

例如:

rewrite ^ https://example.net/? permanent;
有关详细信息,请参阅

或者,使用更简单的返回表达式:

return 301 https://example.net/;