我有一个的index.php 负责处理所有的请求到服务器上的文件。我给自己定了一个404错误重定向的.htaccess 以这种方式:
I have an index.php file which handles all requests to the server. I've set up a 404 error redirect in .htaccess in this way:
ErrorDocument 404 /index.php如果一个用户请求一个文件,比方说, page.php ,那么它就会被重定向到的index.php 正确的页面。
If a users request a file, say, page.php, then it gets redirected to the index.php page properly.
当用户请求的问题就出现了 page.php?页=约,那么我的index.php无法关于使用检索查询 $ _ REQUEST ['页']'。
The problem arises when the users request page.php?page=about, then my index.php is unable to retrieve the queryaboutusing$_REQUEST['page']`.
我怎样才能查询关于通过使用的index.php $ _ REQUEST ['页'] ?
How can i get the query about through the index.php using $_REQUEST['page'] ?
推荐答案$ _ SERVER ['REDIRECT_QUERY_STRING'] 可能包含您的查询字符串。
$_SERVER['REDIRECT_QUERY_STRING'] may contain your query strings.
给这个一杆。
<?php print_r($_SERVER['REDIRECT_QUERY_STRING']); ?>更多推荐
如何通过查询字符串中的404错误通过的.htaccess重定向?
发布评论