Fixing 404 Error with LiteSpeed Web Server

How to fix LiteSpeed permalink settings? 404 LiteSpeed Web Server

As I discussed earlier, those early days with LiteSpeed are neither romantic nor friendly until you love that charm of staying midnight just to figure it out why your permalinks were no longer working when switching from Apache to LiteSpeed. And WordPress slugs would not beautify when the .htaccess promises of great SEO friendly permalinks just don’t work as expected. So, let’s quickly figure out how to fix the permalink issues with the LiteSpeed web servers.

WordPress offers you the ability to create a custom URL structure for your permalinks and archives. Custom URL structures improve the aesthetics, usability, and forward-compatibility of your links. A number of tags are available, and here in this link are some examples to get you started. But…when it just doesn’t work as expected, things look ugly.

If you are seeing the pretty bad 404 NOT FOUND “The resource requested could not be found on this server!” screen in your LiteSpeed Web Server – look nowhere as I’m sharing here my findings (even simple it took me 2 days to figure it out.)

No matter how much settings you keep on changing at the WordPress’s permalink at “yoursite.com/wp-admin/options-permalink.php”. My all time favorite combination of available tags that make up the loved permalink is “/%category%/%postname%/” to justy article’s own postname and to which category it does belong to.

Let’s fix permalink structure in LiteSpeed WordPress: 

Open your OpenLiteSpeed “LiteSpeed WebAdmin Console” dashboard and on the navigation bar open Virtual Hosts. Find your domain on the Virtual Host List. Open it, select the Rewrite tab.

On the Rewrite tab of your Virtual Host, under the Rewrite Control box edit Enable Rewrite and Auto Load from .htaccess select Yes for the both fields.  Configuration has been modified. To apply changes, please perform a graceful restart.

Enabling rewrite for virtual host in OpenLiteSpeed

Simply doing this still may not give you the permalink structure you opted for – better check once if in case this has fixed your permalink issues. Now that open .htaccess on your document root (not the server or virtual host root) – where your actual WordPress files are located and insert the actual .htaccess content generated by WordPress on your earlier version. Or for the sake of simplicity, I’m sharing my htaccess content and should fairly work for you as well. Everything inside the <IfModule mod_rewrite.c> is copied to the htaccess file.

#BEGIN LSCACHE
#END LSCACHE
.....
#BEGIN NON_LSCACHE
#END NON_LSCACHE
#Forcing HTTPS rule start
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
#Forcing HTTPS rule end
#BEGIN WordPress
#The directives (lines) between BEGIN WordPress and END WordPress are
#dynamically generated, and should only be modified via WordPress filters.
#Any changes to the directives between these markers will be overwritten.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
<IfModule>
#END WordPress

This is all. You have now noticed how powerful .htaccess file is. Happy SEOing with fixed permalink structure on your WordPress website hosted at LiteSpeed Web Server.

About The Author

3 thoughts on “How to fix LiteSpeed permalink settings? 404 LiteSpeed Web Server”

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top