将所有请求重定向到单个文件,并通过htaccess和php获取请求的数据

时间:2014-03-04 12:27:07

标签: php apache .htaccess request http-status-code-404

我想知道如何通过php和.htaccess

获取所有请求的链接

基本上我希望所有请求(实际上不作为文件存在)将被定向到index.php

并从index.php我将回显显示的请求。

所以iow:

https://puaction.com/nonexistedpage.php

将转到:

https://puaction.com/404.php

和404.php

<?php

$reqpage = /* fetch from htaccess */

echo 'the page : '.$reqpage.' that you requested is not exists';

?>

1 个答案:

答案 0 :(得分:0)