I'm asking for help with a redirection problem with my .Htaccess file When redirecting 401, 403, 404... in a subfolder of my site, the display of the error is in the path of the subfolder and not at the root of the site.
If www.mysite.com/test/index.html not exist, the error show www.mysite.com/test/index.html with my 404 page include without my CSS
I have a redirection rule to shorten urls in the htaccess. The URL shortener use a random combination of 4 alpha digit characters
www.mysite.com/cder
www.mysite.com/adj4
I searched at the base to create a dynamic error page to log visitors and robots spammer in a text file
Thank you for your answers and advice on the right method
# URL rewriting for Shorten Urls
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/?$ /tinyurl.php?id=$1 [QSA,NC,L]
# ErrorDocument
ErrorDocument 400 /?page=error&code=400
ErrorDocument 401 /?page=error&code=401
ErrorDocument 403 /?page=error&code=403
ErrorDocument 404 /?page=error&code=404
ErrorDocument 405 /?page=error&code=405
ErrorDocument 408 /?page=error&code=408
ErrorDocument 410 /?page=error&code=410
ErrorDocument 411 /?page=error&code=411
ErrorDocument 412 /?page=error&code=412
ErrorDocument 413 /?page=error&code=413
ErrorDocument 414 /?page=error&code=414
ErrorDocument 415 /?page=error&code=415
ErrorDocument 500 /?page=error&code=500
ErrorDocument 501 /?page=error&code=501
ErrorDocument 502 /?page=error&code=502
ErrorDocument 503 /?page=error&code=503
ErrorDocument 506 /?page=error&code=506