This is an old revision of the document!

LSWS 5.3 Improves rewrite Engine to match Apache behavior

There are some improvements on LSWS 5.3 rewrite Engine to match Apache behavior. Hence some rewrite rules may work on LSWS 5.2.x but it may break after upgrading to 5.3.x. Don't worry, the purpose of the new changes is just to align the rewrite rules to match Apache behavior and generally some minor changes should fix the issue.

For example, LSWS 5.3 ignores “RewriteBase /” in a subdirectory. If someone uses it as a feature, it will break on LSWS 5.3 while it may work with 5.2.x and below version. The fix is to rewrite to absolute URL, instead of relative URL, or fix the rewrite base.

in /home/user1/public_html/sub1/.htaccess sub folder “sub1” of domain's the document root:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^(.*) index.php [L]

For rewrite rule, you should not use RewriteBase / at subfolder. The fix is easy: just update the last rewrite rule to

RewriteRule ^(.*) /index.php [L]

The new rules are actually correct rules, which should work on both LSWS 5.3.x, LSWS 5.2.x and Apache.

  • Admin
  • Last modified: 2018/11/06 15:29
  • by Jackson Zhang