I have a PHP file on my error subdomain (https://errors.example.com
).
And this is meant to serve as the error page for all subdomains.
The format it goes through is https://errors.example.com?type=error?error=404
just an example but when I receive a 404 on a different sub. Or the main I get redirected to there. And that messes with the path that it shows... And it exposes where my error pages are...
My .htaccess
file:
Options +Indexes
Order deny,allow
<IfModule !mod_ssl.c>
Redirect permanent / https://www.example.com/
</IfModule>
ErrorDocument 400 https://errors.example.com?type=error&error=400
ErrorDocument 401 https://errors.example.com?type=error&error=401
ErrorDocument 403 https://errors.example.com?type=error&error=403
ErrorDocument 404 https://errors.example.com?type=error&error=404
ErrorDocument 451 https://errors.example.com?type=error&error=451
ErrorDocument 500 https://errors.example.com?type=error&error=500
## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType text/html "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType text/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 1 month"
</IfModule>
## EXPIRES CACHING ##