htaccess causing 500 internal error in litespeed but OK on apache

#1
Hello,

I am using a subdomain handler script from Randall Krause (http://www.webmasterworld.com/apache/3163397.htm) which has always been working 100% perfectly on apache but is causing 500 internal errors since I moved to litespeed.

Code:
RewriteBase /

#### URL Rewrite Handler for Subdomains (by Randall Krause) ####

RewriteCond %{ENV:REDIRECT_SUBDOMAIN} =""
RewriteCond %{HTTP_HOST} ^([a-z0-9][-a-z0-9]+)\.mydomain\.org\.?(:80)?$ [NC]
RewriteCond %{DOCUMENT_ROOT}/subdomains/%1 -d
RewriteRule ^(.*) subdomains/%1/$1 [E=SUBDOMAIN:%1,L]
RewriteRule ^ - [E=SUBDOMAIN:%{ENV:REDIRECT_SUBDOMAIN},L]
I don't understand what can cause the internal errors but there must be a syntax "misunderstood" by litespeed or handled differently on litespeed.

Any idea as to what could be the cause of this problem ?

Thanks a lot,

Cheers,
 

mistwang

LiteSpeed Staff
#2
Looks like %{ENV:REDIRECT_SUBDOMAIN} is not set, as it is not a standard environment variable. Just try the simplified rule.

RewriteCond %{ENV:SUBDOMAIN} =""
RewriteCond %{HTTP_HOST} ^([a-z0-9][-a-z0-9]+)\.silverwayve\.com\.?:)80)?$ [NC]
RewriteCond %{DOCUMENT_ROOT}/subdomains/%1 -d
RewriteRule ^(.*) subdomains/%1/$1 [E=SUBDOMAIN:%1,L]
 
Top