[英]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.