Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/56.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
Url rewriting web.config重写规则:从一个查询字符串重写到包含第一个查询字符串的另一个查询字符串_Url Rewriting_Query String - Fatal编程技术网

Url rewriting web.config重写规则:从一个查询字符串重写到包含第一个查询字符串的另一个查询字符串

Url rewriting web.config重写规则:从一个查询字符串重写到包含第一个查询字符串的另一个查询字符串,url-rewriting,query-string,Url Rewriting,Query String,我有一个问题如下: 我想将/index.php?作业改写为伦敦的/index.php?零售作业 我尝试了以下规则: <rule name="jobs" stopProcessing="true"> <match url="index.php$" /> <conditions trackAllCaptures="true"> <add input="{QUERY_STRING}" pattern="jobs" /> &l

我有一个问题如下:

我想将/index.php?作业改写为伦敦的/index.php?零售作业

我尝试了以下规则:

<rule name="jobs" stopProcessing="true">
   <match url="index.php$" />
   <conditions trackAllCaptures="true">
      <add input="{QUERY_STRING}" pattern="jobs" />
   </conditions>
   <action type="Redirect" appendQueryString="false" url="http://www.domain.com/index.php?retail-jobs-in-london" />
</rule>

但是,我在伦敦的预期页面/index.php?retail jobs中得到了一个错误,我相信这是因为“jobs”在预期页面的查询字符串中,所以它尝试循环

我怎样才能明确地查找一个精确且仅为“作业”的查询字符串

提前感谢

这应该行得通

更改此行,使正则表达式与字符串的开头和结尾匹配:

或者,您可以将其更改为仅在以“jobs”开头时匹配,这将在末尾添加其他内容时处理:


非常感谢您的快速回答-这就是我所需要的。这么快我还不能接受你的回答!