开发者

Apache rewrite rule can't output "?" as argument

开发者 https://www.devze.com 2023-03-17 00:44 出处:网络
I added an Apache rewrite rule to convert a static static URL to a PHP URL, but I will miss the output after the question mark.

I added an Apache rewrite rule to convert a static static URL to a PHP URL, but I will miss the output after the question mark.

For example:

RewriteRule test/([^/]+)/([^/]+)/([^/]+) 48/thread.php?tid=123 [L]

But it seems every time when I input http://www.exmple.c开发者_Python百科om/new_sr/test/hi/1d62c59da779043b2f6bda467fdae41a/

I just get the URL

/new_sr/48/thread.php

But I expect to get the URL

48/thread.php?tid=123

"?tid=123" is discarded.

Why?


Try this,

RewriteRule test/([^/]*)/([^/]*)/([^/]*) 48/thread.php?tid=123 [L]

BTW, you can test your rules in this link: http://martinmelin.se/rewrite-rule-tester/

0

精彩评论

暂无评论...
验证码 换一张
取 消