Page is a not externally linkable
extras - 7:33 pm on Jan 21, 2006 (gmt 0)
I think it worked up to Apache 1.3.27 or so. I wrote several different version of sub (and pointed) domain RewrireRules. Here is one of them. # Loop stopping and Virtual document root processing for CGI/PHP # Code for missing Trailing slashe problem # Sub/pointer domain rewrite code The virtualdr.cgi prevents the problem of ugly URL and I'll post URL for this and other code and explanation.
The backref \1 in this part doesn't work in the newer version fo Apache1.3, AFAIK.
rewritecond %2<->%3_SPACE_!^(.*)<->\1$ [NC]
RewriteEngine on
RewriteBase /
#RewriteRule ^/*virtualdr.cgi - [L]
#RewriteRule ^/*[^./]+\.[^/]+/.*\.(cgi¦php5?)$ virtualdr.cgi [L]
RewriteRule ^/*[^./]+\.[^/]+/.*$ - [L]
RewriteCond s%{HTTPS} ^((s)on¦s.*)$
RewriteRule ^/*(.+/)?([^.]*[^/])$ http%2://%{HTTP_HOST}/$1$2/ [L,R=301]
RewriteCond %{HTTP_HOST}!^(www\.)?(MAINDOMAIN\.?COM¦USER) [NC]
RewriteCond %{HTTP_HOST} ^(www\.)?(.*)$ [NC]
RewriteRule ^(.*)$ %2/$1
Directory layout:
/path-to-docroot/ <== MainDomain in docroot
/path-to-docroot/subdom1.maindomain.com/ <== Directory for sub domain
/path-to-docroot/subdom2.maindomain.com/ <== Directory for sub domain
/path-to-docroot/pointed-domain.com/ <== Directory for pointed domain
/path-to-docroot/sub.pointed-domain.com/ <== Directory for sub domain of pointed domain
some scripts simply failing when the docroot is presented differently.
if it's allowed
If not, you can google and it appears near the top with "virtualdr.cgi".