Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/url/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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/github/3.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
重写2个查询的URL_Url_Rewrite - Fatal编程技术网

重写2个查询的URL

重写2个查询的URL,url,rewrite,Url,Rewrite,我不知道如何在URL重写中有两个查询 我知道下面将允许我有一个单一的查询 RewriteRule ^movie/(.+)$ movie.php?url=$1 example.com/movie/superman 但我如何在其中添加另一个查询 example.com/cinema/vue-sheffield/movie/superman 我做的每件事似乎都不管用 谢谢这不一定是一个查询,这取决于您正在使用的web服务。?后面的内容是URL参数列表,其中可以有多个URL参数,由和分隔。通常

我不知道如何在URL重写中有两个查询

我知道下面将允许我有一个单一的查询

RewriteRule ^movie/(.+)$   movie.php?url=$1

example.com/movie/superman
但我如何在其中添加另一个查询

example.com/cinema/vue-sheffield/movie/superman
我做的每件事似乎都不管用


谢谢

这不一定是一个查询,这取决于您正在使用的web服务。
后面的内容是URL参数列表,其中可以有多个URL参数,由
分隔。通常情况下,顺序或参数并不重要,更常见的情况是,它们的形式是
?foo=bar&etc=which


我不确定你关于重写的问题是什么。

如果你的电影总是谢菲尔德,你可以这样做

RewriteRule ^cinema/vue-sheffield/movie/([^/]+) index.php?movie=$1&cinema=sheffield&%{QUERY_STRING} [L]
如果没有,那么你可以这样做

 RewriteRule ^cinema/([^/]+)/movie/([^/]+) index.php?cinema=$1&movie=$2&%{QUERY_STRING} [L]
那你就可以


example.com/cinema/whateverhere/movie/somemovie

另一个查询是什么意思?您希望url看起来像
eexample.com/cinema/vue-sheffield/movie/superman
,但被转发到movie.php?url=$1?我希望能够格式化example.com/index.php?cinema=sheffield&movie=superman,以阅读地址barI中的example.com/cinema/vue-sheffield/movie/superman,因为barI并不总是同一家电影院。我希望能够改变电影院和电影更新我的答案。这就是你想要的吗?