Our custom error documents are defined globally as follows:
When for example the following htaccess is in place and index.php is missing, the custom 404 error gets ignored and shows the default one (with LiteSpeed signature):
Code:
Alias /cust_err_doc/ "/var/http/"
ErrorDocument 301 /cust_err_doc/errors/301.php
ErrorDocument 302 /cust_err_doc/errors/302.php
ErrorDocument 400 /cust_err_doc/errors/400.php
ErrorDocument 404 /cust_err_doc/errors/404.php
ErrorDocument 403 /cust_err_doc/errors/403.php
ErrorDocument 500 /cust_err_doc/errors/500.php
Code:
RewriteEngine on
RewriteBase /
RewriteCond %{http_host} ^domain.tld [nc]
RewriteRule ^(.*)$ http://www.domain.tld/$1 [r=301,nc]
RewriteRule ^cms$ /cms/ [r=301,nc]
RewriteRule ^(en|fr|nl)?/?([a-z0-9\-/_]+)?(.htm)?$ /index.php?ls=$1&page=$2
RewriteCond %{REQUEST_URI} !^/plugins/
RewriteRule .html$ /index.php?ls=en&page=
ErrorDocument 404 /page-not-found.htm