And*_*w M 1 php .htaccess mod-rewrite
我有一个.htaccess文件,它使用路由查询字符串参数将所有URL重定向到index.php文件:
# Enable Mod_rewrite
RewriteEngine on
# Redirect pretty URLs to the index file
RewriteRule ^([\w\/\-]+)/?$ index.php?route=$1
Run Code Online (Sandbox Code Playgroud)
这很有用,但带有查询字符串的URL除外.例如,我有一个表单,重定向回登录屏幕,并带有错误代码(/admin/login?error=1).显然,问题是,$_GET[error]参数永远不会传递给主脚本.
我如何将这些参数传递给脚本?
| 归档时间: |
|
| 查看次数: |
1514 次 |
| 最近记录: |