Hello,
I’m using OpenLitespeed Wordpress on Digital Ocean droplet. I was able to access my blog but now I’m getting 404 for all post and pages except the Homepage.
When I set permalink to plain, everything seems to be working. But when I choose to put post-name as permalink, I’m getting 404 error.
When I check wordpress health, it is showing that ‘the rest api encountered an unexpected result litespeed server’.
And also, https://site.com/wp-json/wp/v2/posts/ when I access this path with my site, I get a 404.
Kindly let me know the solution for this issue. TIA.
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!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Hey @triber9999,
I think the issues you’re experiencing are related to how OpenLiteSpeed (OLS) manages rewrite rules.
WordPress pretty permalinks require these rules to function correctly. When permalinks are set to “plain,” they do not rely on rewrite rules, hence they work fine. When you switch to “post name,” they do require these rules, which appear to be not functioning correctly.
Enable rewrite rules in OpenLiteSpeed: Go to the OpenLiteSpeed WebAdmin console, navigate to
Virtual Hosts > Rewrite > Rewrite Control
, and ensure thatRewrite
is set toEnable
.Manually refresh the rewrite rules: In your WordPress admin area, navigate to
Settings > Permalinks
and clickSave Changes
without modifying anything. This will force WordPress to flush its rewrite rules and regenerate them.Hi,
Please try to restart web server with the following command after changing the permalink, and let us know if it fixes the issue for you.
The restart won’t cause any downtime to the site by the way.
Best, Eric