$HTTP["host"] =~ "(www\.|)server\.com" { var.servername = "server.com" # Set basedir for our domains var.basedir = "/var/www/htdocs/domains/" # Documentroot = basedir + servername server.document-root = basedir + servername # Dynamic Wordpress URL rewrite rules # If you run your Wordpress blog under /blogg/ then set var.wproot to "blogg/" var.wproot = "blogg/" url.rewrite-final = ( "^/" + wproot + "page/([0-9]+)/?$" => "/" + wproot + "index.php?paged=$1", "^/" + wproot + "category/(.+)/page/([0-9]+)/?$" => "/" + wproot + "index.php?category_name=$1&paged=$2", "^/" + wproot + "category/(.+)/?$" => "/" + wproot + "index.php?category_name=$1", "^/" + wproot + "arch/category/(.*)/(feed|rdf|rss|rss2|atom)/?$" => "/" + wproot + "wp-feed.php?category_name=$1&feed=$2", "^/" + wproot + "arch/category/?(.*)" => "/" + wproot + "index.php?category_name=$1", "^/" + wproot + "arch/author/(.*)/(feed|rdf|rss|rss2|atom)/?$" => "/" + wproot + "wp-feed.php?author_name=$1&feed=$2", "^/" + wproot + "arch/author/?(.*)" => "/index.php?author_name=$1", "^/" + wproot + "arch/([0-9]{4})?/?([0-9]{1,2})?/?([0-9]{1,2})?/?([_0-9a-z-]+)?/?([0-9]+)?/?$" => "/" + wproot + "index.php?year=$1&monthnum=$2&day=$3&name=$4&page=$5", "^/" + wproot + "([0-9]{4})?/?([0-9]{1,2})?/?([0-9]{1,2})?/?([_0-9a-z-]+)?/?([0-9]+)?/?$" => "/" + wproot + "index.php?year=$1&monthnum=$2&day=$3&name=$4&page=$5", "^/" + wproot + "arch/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([_0-9a-z-]+)/(feed|rdf|rss|rss2|atom)/?$" => "/" + wproot + "wp-feed.php?year=$1&monthnum=$2&day=$3&name=$4&feed=$5", "^/" + wproot + "arch/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([_0-9a-z-]+)/trackback/?$" => "/" + wproot + "wp-trackback.php?year=$1&monthnum=$2&day=$3&name=$4", "^/" + wproot + "feed/?([_0-9a-z-]+)?/?$" => "/" + wproot + "wp-feed.php?feed=$1", "^/" + wproot + "comments/feed/?([_0-9a-z-]+)?/?$" => "/" + wproot + "wp-feed.php?feed=$1&withcomments=1" ) }