Enable .htaccess support in OpenLiteSpeed by setting “Auto Load from .htaccess” to Yes in the WebAdmin Console, then restart the server. OpenLiteSpeed (OLS) supports Apache-style .htaccess files, making it a popular drop-in replacement for Apache on WordPress sites. However, OLS only supports mod_rewrite directives from .htaccess – it ignores other Apache directives like <Files>, <IfModule>, and Order allow,deny. This guide shows the official method for enabling .htaccess at both the server level and the virtual host level. Information verified against the official OpenLiteSpeed documentation.
Before enabling .htaccess support, it’s important to know what OLS will and won’t process. Unlike Apache, OpenLiteSpeed processes only mod_rewrite directives from .htaccess files. Other common Apache directives are bypassed entirely.
Supported:
RewriteEngineRewriteRuleRewriteCondRewriteBase (in .htaccess only, not in vhost configs)Not supported (silently bypassed):
<Files> and <FilesMatch> directives<IfModule> blocksOrder allow,deny / Deny from allOptions -Indexes and similar Options directivesAuthType, AuthName, and authentication directivesWorkaround for unsupported directives: Convert file restrictions and access control rules to mod_rewrite syntax. For example, instead of <Files readme.html>Deny from all</Files>, use RewriteRule ^/?readme\.html$ - [F,L]. The result is the same – a 403 Forbidden response.
Enabling .htaccess at the server level applies the setting to all virtual hosts on the OpenLiteSpeed server.
https://your-server-ip:7080 and log in with your administrator credentials.If you only want .htaccess support for one site instead of the entire server, configure it at the virtual host level.
Subdirectories are automatic. Since OpenLiteSpeed v1.5.4, .htaccess files in subdirectories are automatically loaded once the setting is enabled at the virtual host level. You don’t need to configure each subdirectory individually. Older OLS versions required explicit subdirectory configuration.
OpenLiteSpeed must be restarted for the .htaccess setting and any rewrite rule changes to take effect. Use a graceful restart to avoid downtime:
sudo /usr/local/lsws/bin/lswsctrl restart You can also restart from the WebAdmin Console by clicking the Graceful Restart button in the top navigation bar.
Important: OLS loads .htaccess rules at server startup. Any time you modify the .htaccess file via FTP or SSH, you must restart OpenLiteSpeed for the changes to take effect. Some control panels (like DirectAdmin) automatically restart OLS when .htaccess is edited through their File Manager, but FTP/SSH edits require a manual restart.
WP Ghost writes its rewrite rules to .htaccess on Apache, LiteSpeed, and OpenLiteSpeed servers. If your OpenLiteSpeed server doesn’t have Auto Load from .htaccess enabled, WP Ghost’s rules won’t be applied even though the file is created. The result: hidden paths appear to be saved in WP Ghost settings, but the actual URL rewrites don’t work and your custom paths return 404.
Before installing WP Ghost on OpenLiteSpeed:
If your hosting provider uses OpenLiteSpeed with a control panel (CyberPanel, DirectAdmin) that doesn’t give you access to the WebAdmin Console, contact your host to enable .htaccess support. Most managed OpenLiteSpeed hosts have this enabled by default.
OpenLiteSpeed only loads .htaccess rules at startup. Restart OLS with sudo /usr/local/lsws/bin/lswsctrl restart after any .htaccess change. If you’re editing .htaccess frequently via FTP, set up a cron job that detects changes and restarts OLS automatically.
Check /usr/local/lsws/logs/error.log for the specific directive being rejected. OLS only supports mod_rewrite directives from .htaccess. If you see errors like Invalid rewrite directive: Order allow,deny or Rewrite directive: <IfModule> bypassed, those directives need to be converted to mod_rewrite syntax (see the workaround note in the supported directives section).
This usually means rewrite rules aren’t being processed. Verify that Enable Rewrite is set to Yes on your virtual host, Auto Load from .htaccess is enabled, and OLS has been restarted since saving the WP Ghost settings. If the issue persists, see the Emergency Disable guide to regain access.
Make sure port 7080 is open in your firewall. On Ubuntu: sudo ufw allow 7080. On CentOS: sudo firewall-cmd --add-port=7080/tcp --permanent && sudo firewall-cmd --reload. If you’re using a hosting control panel, the WebAdmin Console may not be accessible to end users – contact your host.
Partially. OLS supports Apache mod_rewrite syntax but not other Apache directives. Apache loads .htaccess on every request, but OLS loads .htaccess only at server startup, which means you must restart OLS after any .htaccess change. The performance benefit of OLS comes from this approach – it processes rewrite rules in memory instead of reading the file on every request.
Virtual host level is recommended for most setups. It gives you per-site control and matches how most Apache configurations work. Use server level only if you want every site on the server to support .htaccess automatically.
CyberPanel uses OpenLiteSpeed by default and typically has .htaccess support enabled out of the box. If WP Ghost isn’t applying rules correctly, check your virtual host’s Rewrite settings or contact CyberPanel support.
Yes. WP Ghost works on OpenLiteSpeed once .htaccess support is enabled. WP Ghost writes rewrite rules in standard mod_rewrite format, which OLS supports. After enabling .htaccess and saving WP Ghost settings, restart OpenLiteSpeed to apply the rules.
Server configuration for WP Ghost:
Replace the default wp_ database prefix with a random one to protect against SQL injection…
Change the WordPress uploads directory path with WP Ghost (rewrite rules, no files moved) or…
Configure WP Ghost with WP Rocket cache. Enable file optimization, Change Paths in Cache Files.…
https://youtu.be/6ylhojSi-_E In this video, we’ll explore why website security matters and what can happen if…
The security of your WordPress site depends on multiple factors, such as the strength of…
Step-by-step guides to connect WP Ghost 2FA with Google Authenticator, Authy, Microsoft Authenticator, or LastPass.…