custom page error

staff

Verified User
Joined
Sep 19, 2007
Messages
110
Location
France
Hello,

I have been told that OpenLiteSpeed can read .htaccess however ErrorDocument is not supported and I would therefore have liked to redirect if error redirect to my page error.php

So i did like this but it doesn't work :(
RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule $ /error.php [L,NC]
Thanks for your help
 

ericc

Verified User
Joined
Jan 2, 2018
Messages
28
Location
EU
The same problem. Looks like OpenLiteSpeed doesn't support ErroDocument directive. Following this guide - https://openlitespeed.org/kb/custom-error-page/ I added url of 404.html page in /usr/local/directadmin/data/users/youruser/openlitespeed.conf and it worked. But we need to save it to custom template, so it will not be overwritten in the future. Perhaps someone could comment on that.
 
Top