.htaccess - Apache mod_rewrite help, send folder to subdomain -


i want make .htaccess file this:

from: http://www.domain.com/example   -or-  http://domain.com/example   to:   http://example.domain.com   

and

from: http://www.domain.com/example/newfolder/file.html?q=blank   -or-  http://domain.com/example/newfolder/file.html?q=blank   to:   http://example.domain.com/newfolder/file.html?q=blank   

for life of me, have searched , searched, , can't figure out.

try rule:

rewritecond %{http_host} ^(www\.)?example\.com$ rewriterule ^([^/.]+)(/.*)?$ http://$1.example.com$2 [l,r=301] 

Comments

Popular posts from this blog

javascript - Enclosure Memory Copies -

php - Replacing tags in braces, even nested tags, with regex -