By komi
I’m having a strange behavior on my OpenLiteSpeed Wordpress server.
If for example I’m pointing to https://mywebsite/wp-content/uploads/2019/
I’m seeing the default litespeed 404 error page, but if I’m pointing to a non existent file/folder on my server, I’ll see my wordpress 404 custom error page.
So how can I remove the default litespeed 404 error page so that I can only use my custom one?
I have also removed the /usr/local/lsws/Example/html/error404.html
and deleted my browser’s cache but still no change.
Any help is appreciated. Thank you!
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Accepted Answer
Hi @komi ,
Getting an OpenLiteSpeed 404 page from https://mywebsite/wp-content/uploads/2019/ is due to there’s no index file exist.
You can fix it by (wiki):
Customized Error Pages
section in the middle of the page. Click Add and choose 404 Not Found
as your Error Code and your costumed error page to URL location.There’s another solution which I am not recommended which is by setting Auto Index
to Yes from Virtual Hosts > wordpress > General > Index Files
Non-exist folder/file return you a correct 404 page is possibly due to hit below example rewrite rules and then rewrite to an index file automatically. In this case, you may hit the back-end PHP and return you the custom/correct 404 page.
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
FYI, OpenLiteSpeed has a 404 page built-in the code so even deleting the file it will still show.
Best, Eric
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.