Just got litespeed working with rails virtual host template. Now I want set the virtual host to mod_rewrite for multiple rails apps.
For example, I type http://app1.example.com, I want litespeed run the rails app at /var/www/rails/app1, http://app5.exmaple.com at /var/www/rails/app5, and etc.
For apache, I had this mod_rewrite setup.
RewriteCond %{HTTP_HOST} [^.]+\.example\.com$
RewriteRule ^(.+) %{HTTP_HOST}$1 [C]
RewriteRule ([^.]+)\.example\.com(.*) /var/www/rails/$1$2
So on my litespeed config for rails virtual host, I have turn on rewrite and put in those 3 lines in the rewrite rules. I have also setup the wildcard on the hostname as *.example.com.
So what am I missing that will get this working?
Thanks.
For example, I type http://app1.example.com, I want litespeed run the rails app at /var/www/rails/app1, http://app5.exmaple.com at /var/www/rails/app5, and etc.
For apache, I had this mod_rewrite setup.
RewriteCond %{HTTP_HOST} [^.]+\.example\.com$
RewriteRule ^(.+) %{HTTP_HOST}$1 [C]
RewriteRule ([^.]+)\.example\.com(.*) /var/www/rails/$1$2
So on my litespeed config for rails virtual host, I have turn on rewrite and put in those 3 lines in the rewrite rules. I have also setup the wildcard on the hostname as *.example.com.
So what am I missing that will get this working?
Thanks.