Hello
So I'm trying to write xyz.dom.com --> dom.com/app/index?n=xyz
or in the case of:
xyz.dom.com/something?stuffstuff dom.com/app/something?stuffstuff&n=xyz
But I seem to be failing miserably
# Skip rewrite if no hostname or if subdomain is www
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^www\. [NC]
# Extract (required) subdomain (%1), and first path element (%3), discard
RewriteCond %{HTTP_HOST}<>%{REQUEST_URI} ([^.]+)\.dom\.com(:80)?<>/([^/]*) [NC]
# Rewrite only when subdomain not equal to first path element stop recursion
RewriteCond %1<>%3 !^(.*)<>\1$ [NC]
# Rewrite to /subdomain/path
RewriteRule ^(.*) /app/%1/$1 [L]
I get stuck in some sort of modrewrite loop..
Any help would MUCH be appreciated.
Thanks in advance.