簡體   English   中英

如何通過.htaccess傳遞404錯誤重定向中的查詢字符串?

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

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM