Hi,
Background:
I'm using Apache 2.0.54. Under the htdocs folder, I creater some subfolders, one per subdomain (e.g. -fred, -john etc.). Note the names start with a hyphen. The idea is to route users of subdomains to (and lock them into) their allocated folders and subfolders.
However, I have also a few dynamic systems on the same server. Each of these systems consists of a Apache DSO, a FireBird DB and a CSS (no static pages and therefore no subfolders, stating with a hyphen).
Two examples of these systems are:
http://sarnap.nolsmit.com or http://www.nolsmit.com/sarnap
http://geosites.nolsmit.com or http://www.nolsmit.com/geosites
(the second one may also use parameters as reflected in the .htaccess file. Replace nolsmit with infoveld for a live system).
My problem:
In my .htaccess file, if the user access a dynamic system: How do I bypass the code below #-----------Automatically route to subdomain's home page
My complete .htaccess file:
RewriteEngine on
Options +FollowSymlinks
RewriteBase /
RewriteRule ^.htaccess$ - [F]
#-----------Allow/Prevent Directory Browsing
IndexIgnore */*
#Options +Indexes
#-----------Automatically route to subdomain's home page
#(Dynamic systems must bypass this part)
RewriteCond %{REQUEST_URI} !^/-
RewriteCond %{HTTP_HOST} ^(www\.)?([^\.]+)
RewriteCond %{DOCUMENT_ROOT}/-%2 -d
RewriteRule ^(.*)$ -%2/$1 [L]
#-----------Handle search engine friendly parameters
RewriteRule ^(.*)report([0-9]+)-site([0-9]+)$ $1?report_id=$2&site_id=$3
RewriteRule ^(.*)report([0-9]+)-country([0-9]+)$ $1?report_id=$2&country_id=$3
RewriteRule ^(.*)report([0-9]+)-country([0-9]+)-province([0-9]+)$ $1?report_id=$2&country_id=$3&province_id=$4
RewriteCond %{HTTP_HOST} ^geosites\.nolsmit\.com$ [NC]
RewriteRule ^(.*)$ http://www.nolsmit.com/geosites$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^geositesupdate\.nolsmit\.com$ [NC]
RewriteRule ^(.*)$ http://www.nolsmit.com/geositesupdate$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^sageolit\.nolsmit\.com$ [NC]
RewriteRule ^(.*)$ http://www.nolsmit.com/sageolit$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^geoinfo\.nolsmit\.com$ [NC]
RewriteRule ^(.*)$ http://www.nolsmit.com/geoinfo$1 [R=301,L]