[英]how to Pass query string in 404 error redirect through .htaccess?
我有一个index.php
文件,该文件处理对服务器的所有请求。 我已经通过以下方式在.htaccess
中设置了404错误重定向:
ErrorDocument 404 /index.php
如果用户请求文件,例如page.php
,那么它将被正确地重定向到index.php
页面。
当用户请求page.php?page=about, then my index.php is unable to retrieve the query
时出现问题page.php?page=about, then my index.php is unable to retrieve the query
using
$ _REQUEST ['page']` page.php?page=about, then my index.php is unable to retrieve the query
。
我怎样才能查询about
通过使用index.php文件$_REQUEST['page']
$_SERVER['REDIRECT_QUERY_STRING']
可能包含您的查询字符串。
试一下。
<?php
print_r($_SERVER['REDIRECT_QUERY_STRING']);
?>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.