How to Setup Virtual Host in Open LiteSpeed Server

Setup Virtual Host in Open Litespeed Server

From the Listener list select port 80 and click on magnifier icon to enter.

Now, under Virtual Host Mappings add your domain to enable connection.

Virtual Host *Select from list
Domains *

Enable Virtual Hosts

open litespeed virtual host
Virtual Host Nameyour_site_name
Virtual Host Root$SERVER_ROOT/your_site_name
Config File$SERVER_ROOT/conf/vhosts/your_site_name/vhconf.conf
Follow Symbolic LinkYes
Enable Scripts/ExtAppsYes

After enter aboe options correctly click on save button on right top.

Probably you see an error saying no virtual host file and click on click to create option.

Now you have created a basic virtual host file.

Now we have to add additional detail to it to work properly.

View / Edit Virtual Host File

Now view your newly created virtual host file using the magnifier icon.

SELECT > General Tab

Document Root$VH_ROOT/html

SELECT > Rewrite Tab

Enable RewriteYes
Auto Load from .htaccessYes

Do only if you have SSL enabled

Paste below code UNDER Rewrite Rules >

rewriteCond %{HTTPS} !on
rewriteCond %{HTTP:X-Forwarded-Proto} !https
rewriteRule ^(.*)$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]

You have successfully configured virtual host file for your domain for Open LiteSpeed Server.

Leave a Comment