My rewrite rules not working, is it a LiteSpeed bug?

Make sure the rewriting engine has been enabled:

RewriteEngine On

Place the following in related Directory Directive in the httpd.conf to enable .htaccess override.

AllowOverride All

Enable the rewrite log if you have such privileges. Set RewriteLog path and RewriteLogLevel.

For Apache vhost, add the following to httpd.conf. (Apache 2.2 reference RewriteLogLevel Directive)

RewriteLogLevel 2 #(up to 9)

It has been replaced by the following new per-module logging configuration mentioned in 2.4 version:(Apache 2.4 reference)

LogLevel alert rewrite:trace3 #( up to trace8 log levels)

To get just the mod_rewrite-specific log messages, pipe the log file through grep:

tail -f error_log|fgrep '[rewrite:'

For LSWS native vhost, LSWS web admin → Virtual Host → vhost abc → Rewrite → Log Level:9

Then check the log for errors.

For WHM/cPanel, it's usually located at /usr/local/apache/logs/error_log.

For LSWS native server or vhosts, the error log file paths are configured in LSWS web admin → Server or Virtual Hosts → Log.

Sometime you may be wondering why it was working with Apache before but now seems not working with LiteSpeed. Is that true? Try to switch to Apache to test your rule to make sure it is really working before you log a bug with LiteSpeed. Quite often, it doesn't work with Apache either and rule sets need to be reordered or modified.

  • Admin
  • Last modified: 2015/07/30 19:15
  • by Michael Alegre