RewriteCond %{HTTP_HOST} !^www\.DOMAIN\.com
RewriteCond %{HTTP_HOST} ^(.*)\.DOMAIN\.com
RewriteRule ^(.*)$ http://DOMAIN.com/FolderName/$1 [L]
If I type in SubDomain.DOMAIN.COM it redirects me to DOMAIN.COM/Folder/ fine, but I do not want the url in the browser address bar to change to DOMAIN.COM/Folder/ but remain as SubDomain.DOMAIN.COM.
Any clues to this.
When a rewriterule points to a domain, an explicit redirect will occur. By default a 302 redirect (temporary redirect).
I suggest you to use the
P(proxy) flag. For this to work,mod_proxyshould be enabled.Also remember to set-up a
ProxyReversedirective.So, you cannot have a
ProxyReversein.htaccess.Taken directly from: Proxying Content with mod_rewrite Apache Docs.
Consider using either ProxyPass or ProxyPassMatch whenever possible in preference to mod_rewrite.
Visit this for how to ProxyPass: https://stackoverflow.com/a/9189447/858515