How to setup rewrite rules in lighttpd

Step 1: open lighttpd.rewrite in rootpath of the script.
Step 2: The first to lines is all you have to change

$HTTP["host"] =~ “(^|\.)YOURDOMAINNAME\.COM$” {       //change the to your domain and domain extension
server.document-root = “/YOUR/ROOT/TO/SITE”                     // set the path to your script root

Step 3: Now open your lighttpd.conf and add:

$HTTP["host"] =~ “(^|\.)YOURDOMAINNAME\.com$” {
server.document-root = “/YOUR/ROOT/TO/SITE”
server.errorlog = “/var/log/lighttpd/error.log”
accesslog.filename = “/var/log/lighttpd/access.log”
include “/YOUR/ROOT/TO/SITE/lighttpd.rewirte”

Step 4: Restart your lighttpd and your done

Leave a comment

You must be logged in to post a comment.