我已经重定向到一个自定义错误页面。但我不想从400、401或403命中的位置获取请求的URI。我完全不懂htaccess编码。这就是我目前所拥有的:
ErrorDocument 400 'example.com/customerror.php'
ErrorDocument 401 'example.com/customerror.php'
ErrorDocument 403 'example.com/customerror.php'
现在,如果请求uri达到400、401或403,我需要以某种方式保存它,然后从自定义错误页面PHP调用它。
示例:
- 用户请求页面:example.com/wp-content/plugins.htaccess
- .htaccess阻止它
- .htaccess保存request_uri(/wp-content/plugins)
- .htaccess重定向到example.com/customerror.php customeerror.php
- 页面显示保存的request_uri(/wp-content/plugins)
有人能帮我做第三步和第五步吗。我已经把其他人都搞定了。我们非常感谢所有的帮助。
您可以在customerror.php
上使用作为上一个请求URI的标头HTTP_REFERER
将其保存为数据库或文件。