繁体   English   中英

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

[英]redirect all request to single file and fetch the requested data via htaccess and php

我想知道如何通过php和.htaccess获取所有请求的链接

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

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

所以哇

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';

?>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM