404 Error on WordPress Website
Of all potential errors that can be found on your WordPress website, Error 404 is one of the harmless ones. However, this type of error can be frustrating both for you and your website visitors. Stumbling upon Error 404 is not something that you want your first-time visitors to experience. A 404 can be an indicator for some changes, and that you should add a 301 redirect for SEO purposes.
What is the Error 404 Not Found?
When a visitor goes to your website, then their browser will send a request to the webserver. The browser then receives data that includes something called HTTP header. This header contains HTTP status codes that explain the request status.
The request works perfectly most of the time, and an HTTP status code is never seen. So, if something goes wrong, then the web browser displays a message with the HTTP status code. This is to indicate a particular problem and The Error 404 Not Found message is the result of that whole process.
How to Fix the 404 Error
In case you are getting 404 page not found error on post page for wordpress website, then you need to edit your .htaccess file and replace the existing wordpress rules with these rules :
RewriteBase / RewriteRule ^/index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L]
“/” is the location WordPress was installed relative to the vhost docroot.
Save the file and restart litespeed. Voila, it should work now !
In case you are using cyberpanel, then make sure you edit the .htaccess file from the filemanager and save it once from there. Directly editing the file from terminal doesn’t seems to work in the way it works.