Hi,
I'm new to litespeed and the whole rewrite rules thing. I migrated from lighttpd on a shared host, so forgive me in advance for any dumb questions!
Rewrite rules I'm trying to get working:
1) the first rewrite rule takes all css files in /css directory and uses combine.php script to merge them as one, gzip it to compress through the browser.
2) same thing except with javascript files.
3)I'm trying to redirect all requests to example.com to www,example,com (my $VH_NAME being example.com)
I'm unable to get any of them working; I'm not using .htaccess here but rather Lsws' rewrite function ( Enable Rewrite:yes, log level: 9).
I've also tried using .htaccess with the rewrite rules above (with rewrite engine on and rewrite base /) and put one in my $VH_ROOT ($SERVER_ROOT/sites/example.com), one in the document root, and one in the $SERVER_ROOT.
I've set the .htaccess and allowed fileinfo override for both server and virtual host levels but these don't work for me either.
Thanks for all your help!
I'm new to litespeed and the whole rewrite rules thing. I migrated from lighttpd on a shared host, so forgive me in advance for any dumb questions!
Rewrite rules I'm trying to get working:
1) the first rewrite rule takes all css files in /css directory and uses combine.php script to merge them as one, gzip it to compress through the browser.
2) same thing except with javascript files.
3)I'm trying to redirect all requests to example.com to www,example,com (my $VH_NAME being example.com)
RewriteRule ^/usr/local/lsws/sites/example/html/css/(.*\.css) /usr/local/lsws/sites/example/combine.php?type=css&files=$1
RewriteRule ^/usr/local/lsws/sites/example/html/javascript/(.*\.js) /usr/local/lsws/sites/example/combine.php?type=javascript&files=$1
RewriteCond %{HTTPHOST} ^$VHNAME RewriteRule ^(.*)$ http(colon)//www(dot)$VH_NAME/$1 [R=permanent,L]
(please don't mind the (colon) : and the (dot) . in the last rewrite rule- As a new member on LSWS forum, I cant post any links until after 5 posts)
RewriteRule ^/usr/local/lsws/sites/example/html/javascript/(.*\.js) /usr/local/lsws/sites/example/combine.php?type=javascript&files=$1
RewriteCond %{HTTPHOST} ^$VHNAME RewriteRule ^(.*)$ http(colon)//www(dot)$VH_NAME/$1 [R=permanent,L]
(please don't mind the (colon) : and the (dot) . in the last rewrite rule- As a new member on LSWS forum, I cant post any links until after 5 posts)
I've also tried using .htaccess with the rewrite rules above (with rewrite engine on and rewrite base /) and put one in my $VH_ROOT ($SERVER_ROOT/sites/example.com), one in the document root, and one in the $SERVER_ROOT.
I've set the .htaccess and allowed fileinfo override for both server and virtual host levels but these don't work for me either.
Thanks for all your help!
Last edited: