Php 如何允许一个"&引用;在.htaccess文件中?
我一直在试图弄清楚如何使用htaccessrewrite在带有参数的url中添加问号 我在找这样的东西:Php 如何允许一个"&引用;在.htaccess文件中?,php,.htaccess,url-rewriting,Php,.htaccess,Url Rewriting,我一直在试图弄清楚如何使用htaccessrewrite在带有参数的url中添加问号 我在找这样的东西: https://website.com/auth?login=yes&redirecturl=www.google.com 请记住,这只是我努力实现的一个例子 这是重写文件 RewriteEngine On RewriteRule ^([a-zA-Z0-9_-]+)$ index.php?key=$1 RewriteRule ^([a-zA-Z0-9_-]+)/$ index
https://website.com/auth?login=yes&redirecturl=www.google.com
请记住,这只是我努力实现的一个例子
这是重写文件
RewriteEngine On
RewriteRule ^([a-zA-Z0-9_-]+)$ index.php?key=$1
RewriteRule ^([a-zA-Z0-9_-]+)/$ index.php?key=$1
提前感谢您的帮助。需要转义:
index.php\?key=$1
您必须使用
所以你的“?”符号应该是%3F,“&”应该是%26,“\”--%5C。我感觉你只是想保留GET参数 看看这个: