简体   繁体   English

域根目录之外的.htaccess错误页面

[英].htaccess error pages outside of domain root directory

I chave an .htaccess file that calls the error.php file located in the domain root directory. 我查找.htaccess文件,该文件调用位于域根目录中的error.php文件。 However, I want to apply the error handling to many different directories all within the same directory but the root directory isn't a domain directory. 但是, 我想将错误处理应用于同一目录中的许多不同目录,但根目录不是域目录。 How can I do this? 我怎样才能做到这一点?

Currently my .htaccess file looks like this... 目前我的.htaccess文件看起来像这样......

Options +FollowSymLinks
ErrorDocument 400 /error.php?t=400
ErrorDocument 401 /error.php?t=401
ErrorDocument 403 /error.php?t=403
ErrorDocument 404 /error.php?t=404
ErrorDocument 500 /error.php?t=500
ErrorDocument 503 /error.php?t=503

(I hope you can understand what I'm trying to describe) (我希望你能理解我想要描述的内容)

Have the file wherever you want it, and symlink it to the specific directories. 将文件放在任何您想要的位置,并将其符号链接到特定目录。

.htaccess cannot have an effect on anything outside the document root. .htaccess 不会对文档根目录之外的任何内容产生影响。

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

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