带正斜杠的PHP get参数
我一直在尝试配置.htaccess文件以获得以下结果: 当通过正斜杠“/”传递参数(在本例中为电子邮件)时,my index.php文件将获得此参数。但我觉得有点不对劲 调用该方法的正确方法: 没有.htaccess的方法: 但即使在配置.htaccess时:带正斜杠的PHP get参数,php,.htaccess,Php,.htaccess,我一直在尝试配置.htaccess文件以获得以下结果: 当通过正斜杠“/”传递参数(在本例中为电子邮件)时,my index.php文件将获得此参数。但我觉得有点不对劲 调用该方法的正确方法: 没有.htaccess的方法: 但即使在配置.htaccess时: <ifmodule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_F
<ifmodule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^.]+)/?$ index.php?email=$1 [QSA,L]
</ifmodule>
重新启动发动机
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则^([^.]+)/?$index.php?电子邮件=$1[QSA,L]
出现以下错误:
找不到
请求的URL localhost/方法/info@email.com在此服务器上找不到
此外,尝试使用ErrorDocument处理请求时遇到404 Not Found错误
我在.htaccess文件中丢失了什么吗
提前感谢。您的规则规定,任何匹配项都不得包含
RewriteRule ^([^.]+)/?$ index.php?email=$1 [QSA,L]
但显然,电子邮件地址包含
RewriteRule ^([^.]+)/?$ index.php?email=$1 [QSA,L]
尝试:
您的规则规定,任何匹配项都不得包含
RewriteRule ^([^.]+)/?$ index.php?email=$1 [QSA,L]
但显然,电子邮件地址包含
RewriteRule ^([^.]+)/?$ index.php?email=$1 [QSA,L]
尝试:
是啊。谢谢@Utkanos:)是的。谢谢@Utkanos:)