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/5/date/2.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
Regex 在mod_rewrite文件中的特定单词之前查找查询字符串的其余部分_Regex_Apache_Mod Rewrite - Fatal编程技术网

Regex 在mod_rewrite文件中的特定单词之前查找查询字符串的其余部分

Regex 在mod_rewrite文件中的特定单词之前查找查询字符串的其余部分,regex,apache,mod-rewrite,Regex,Apache,Mod Rewrite,我有一个url/content/sell.htm?ld=a&id=b&\u escape\u fragment\uuu=它是如何工作的 并希望使用mod_rewrite将其重定向到以下url格式/details?pageIdent=& 所以在这种情况下,服务器url应该是/details?pageIdent=它是如何工作的&ld=a&id=b 我已经为_escape_fragment_u的get参数值编写了以下重写规则,但无法按原样编写规则来获取查询字符串的其余部分 RewriteCond %{

我有一个url
/content/sell.htm?ld=a&id=b&\u escape\u fragment\uuu=它是如何工作的
并希望使用mod_rewrite将其重定向到以下url格式
/details?pageIdent=&

所以在这种情况下,服务器url应该是
/details?pageIdent=它是如何工作的&ld=a&id=b

我已经为_escape_fragment_u的get参数值编写了以下重写规则,但无法按原样编写规则来获取查询字符串的其余部分

RewriteCond %{QUERY_STRING} (?:^|&)_escaped_fragment_=([^&]+)
RewriteRule ^/content/sell\.htm /details?pageIdent=%1 [L,R=301]
任何人都可以帮助我获取查询字符串的其余部分,并将其按原样附加到最终url的末尾。我希望我在解释我自己时有点道理

如果有人能解释一下,regex
(?:^ |&)
表示什么。我只是从某处抄来的

谢谢


吉坦德拉(Jitendra)

通过QSA不就是你想要的吗?我很想知道当你的重写规则中已经有args时,它是如何工作的

RewriteRule ^/content/sell\.htm /details?pageIdent=%1 [L,R=301,QSA]

QSA将附加完整的查询字符串。我不想再次附加escape_片段参数。