This is more of an .htaccess question that a MODX question, but any help would be appreciated.
I have Evo 1.0.5 site where the client wants to have a number of pages in a micro site as a separate subdomain. I have this all the pages working as another folder under the existing Evo site tree. But I cannot make it work as a subdomain.
Basically, I want the pages here:
http://www.mydomain.com/subdomain/
To work when the user goes here:
http://subdomain.mydomain.com/
My current .htaccess file does not work but looks like this:
RewriteEngine On
# the part I think is broken or in the wrong place
RewriteCond %{HTTP_HOST} ^subdomain\.mydomain\.com
RewriteRule ^(.*)$ /subdomain/$1 [L]
# rewrite non-www to www
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^www\.mydomain\.com [NC]
RewriteRule (.*) http://www.mydomain.com/$1 [R=301,L]
# 301 Redirects
RewriteRule ^oldfile.htm(?!l) http://www.mydomain.com/modxalias.html [L,NE,R=301]
# bunch more like this one
# Excluded directories from rewrite rules
RewriteRule ^(manager|assets|blog) - [L]
# The Friendly URLs part
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
Thanks in advance.
Sorry that the forum editor sticks anchors on the urls in my code text.
[ed. note: curmudgeon61 last edited this post 14 years, 7 months ago.]