How to Enable .htaccess in OpenLiteSpeed for WP Ghost Path Security

Moved

This tutorial has moved to the new WP Ghost Knowledge Base where each feature is presented in detail.

View on new site

Enable .htaccess support in OpenLiteSpeed so WP Ghost can write its path security and firewall rewrite rules. Set “Auto Load from .htaccess” to Yes in the OpenLiteSpeed admin panel, then perform a graceful restart.

Why OpenLiteSpeed Needs This Configuration

OpenLiteSpeed is a high-performance web server that is compatible with Apache .htaccess files, but this support is not enabled by default. WP Ghost writes its path security and 8G Firewall rewrite rules to the .htaccess file, just like it does on Apache servers. If OpenLiteSpeed is not configured to read .htaccess, those rules are ignored and WP Ghost falls back to slower WordPress PHP-based redirects.

This is a common issue on servers running CyberPanel with OpenLiteSpeed. After enabling .htaccess support, WP Ghost’s rewrite rules will be processed at the server level, giving you the same fast, lightweight path security that Apache users get.

Step 1 – Access the OpenLiteSpeed Admin Panel

1. Open your browser and navigate to the OpenLiteSpeed web admin panel. The default URL is:

https://your-server-ip:7080/login.php

2. Log in with your administrator credentials.

OpenLiteSpeed web admin panel login page at port 7080

Step 2 – Enable .htaccess Support

You have two options: enable .htaccess for the entire server or for a specific virtual host only.

Option A – Enable Server-Wide

This applies .htaccess support to all websites hosted on the server.

3. Go to Server Configuration > General > Rewrite Control.

4. Change Auto Load from .htaccess to Yes.

5. Click Save.

OpenLiteSpeed Server Configuration Rewrite Control with Auto Load from htaccess set to Yes

Option B – Enable for a Specific Virtual Host

If you only want .htaccess enabled for one site, configure it at the virtual host level.

3. Go to Virtual Hosts and select the virtual host for your WordPress site.

4. Click the Rewrite tab.

5. Set Enable Rewrite to Yes.

6. Set Auto Load from .htaccess to Yes.

7. Click Save.

OpenLiteSpeed Virtual Host Rewrite settings with Enable Rewrite and Auto Load from htaccess both set to Yes

Step 3 – Perform a Graceful Restart

After saving the configuration, OpenLiteSpeed needs a restart to apply the changes. You can do this from the admin panel by clicking the green restart icon, or from the command line:

/usr/local/lsws/bin/lswsctrl restart

On CyberPanel installations, the path may be different. Check your OpenLiteSpeed installation directory if the command above does not work.

OpenLiteSpeed admin panel graceful restart button to apply htaccess configuration changes

Step 4 – Configure WP Ghost and Verify

Now that OpenLiteSpeed reads .htaccess files, configure WP Ghost as you would on any Apache server.

8. Go to WP Ghost > Change Paths.

9. Select Safe Mode or Ghost Mode (Premium).

10. Customize your paths and click Save. WP Ghost writes the rewrite rules to .htaccess automatically.

11. Click the Frontend Login Test to verify your new login path works.

12. Open your site in an incognito browser and confirm the old paths return 404 errors.

If WP Ghost still shows a warning that rewrite rules are being handled by WordPress instead of the server, the .htaccess auto-load is not active. Double-check that you saved the OpenLiteSpeed configuration and performed the restart. For more troubleshooting, see Theme Not Loading Correctly or Website Loads Slower.

Frequently Asked Questions

Is OpenLiteSpeed the same as LiteSpeed Enterprise?

No. OpenLiteSpeed is the free, open-source version. LiteSpeed Enterprise is the paid version that includes native .htaccess support by default. On LiteSpeed Enterprise, WP Ghost works the same as on Apache with no extra configuration. The steps in this tutorial are only needed for OpenLiteSpeed.

Will enabling .htaccess slow down OpenLiteSpeed?

The impact is minimal. OpenLiteSpeed caches .htaccess rules in memory after the first read, so the performance difference is negligible for most sites. The security benefit of having WP Ghost’s rules processed at the server level far outweighs any micro-overhead from .htaccess parsing.

I use CyberPanel. Do I need to do anything different?

CyberPanel uses OpenLiteSpeed under the hood. Follow the same steps above using the OpenLiteSpeed admin panel (port 7080). CyberPanel’s own interface does not expose the .htaccess auto-load setting, so you need to configure it directly in the OpenLiteSpeed admin.

Do I need to restart OpenLiteSpeed every time I change WP Ghost settings?

Not typically. Once .htaccess auto-load is enabled, OpenLiteSpeed reads the .htaccess file on each request (similar to Apache). Changes to .htaccess take effect without a server restart. However, if you change the OpenLiteSpeed admin panel settings themselves, a restart is required.

Does WP Ghost modify WordPress core files?

No. WP Ghost writes rewrite rules to .htaccess and uses WordPress hooks. No core files are moved, renamed, or modified. Deactivating the plugin restores all default paths instantly.