.htaccess files on virtual server folders not read

#1
Hi,

I noticed that one website installation to subfolder failed because seems that litespeed reads the main server level .haccess files but not the ones in file folders in virtualhost.
Log revealed nothing.
 
#3
Hi,

yes in the root directory is wordpress installed so it has [L] tag like this:
Code:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
Also after that there is a second mention:

Code:
# END WWW to non-WWW
RewriteEngine On
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$ [NC]
RewriteRule ^ https://%1%{REQUEST_URI} [L,NE,R=301]
Brgds,
 
Last edited by a moderator:

Unique_Eric

Administrator
Staff member
#4
There is a minor difference in the way LiteSpeed Web Server and Apache treat the [L] flag in rewrite rules. The [L] flag (“L” stands for “Last”) causes mod_rewrite to stop processing the rule set. There are two ways to interpret this:

  1. In most contexts, including LiteSpeed Web Server, this means that if the rule matches, no further rules will be processed. LSWS exits from the rewrite completely to avoid looping.
  2. In Apache, [L] means that if the rule matches, no further rules will be processed in the current iteration. Apache does not exit from the rewrite rule completely, and so there is a possibility of looping.
More info please see https://www.litespeedtech.com/suppo..._difference_on_l_flag_between_lsws_and_apache

LSWS will try to treat `L` tag similar to Apache in the "future" release, for now you can try using only one [L] in your rule set instead of multiple [L]s.
 
#5
Thank you,

I removed the extra [L] tags leaving only the last one. It did not help.

I must be missing something obvious because root .htaccess works. Also if I point directly to subfolders .htaccess file I get an error 403 page like it is supposed to do.
 

Unique_Eric

Administrator
Staff member
#6
Hi viperz,

1. Can you try remove .htaccess from root directory, see if sub folder works?
2. You can also try enable rewrite debug log level to 9 and see process exit by which rule.

If still no luck, Please submit a ticket and we can do a quick check.
 
#7
Hi,

I got 2 related errors:
Code:
2019-01-16 22:23:01.328232ERROR Invalid rewrite directive: options -Indexes +FollowSymLinks
2019-01-16 22:23:01.328279ERROR[(null)] rewrite: invalid rewrite directive while parsing: <ifmodule mod_php5.c>
 
Last edited by a moderator:

Unique_Eric

Administrator
Staff member
#8
Hi,

Is this from openLiteSpeed web server?
I didn't see any +FollowSymLinks related settings from your previous posts, did you set any in rewrite tab?
 
Top