简体   繁体   中英

.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. 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...

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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