apache - Combining URLs with & without subdomain prefix -


on root of hosting account sit 2 important folders: httpdocs , subdomains
in order silently load page index.htm 4 of domainvariations (below) i'm stuck in bits n pieces other answers don't join make work:

    team.bravo.org          bravo.org www.team.bravo.org      www.bravo.org 

the server folder structure:

/httpdocs/    index.htm    .htaccess       [1]  /subdomains/    /team/       .htaccess    [2]     /www.team/       .htaccess    [3] 

in .htacces [1] siting in httpdocs folder non-www gets nicely redirected www using:

rewritecond %{http_host} !^(www\.|$) [nc] rewriterule ^ http://www.%{http_host}%{request_uri} [r=301,l] 

what needs go the first, second , third '.htaccess'file make domains redirect permanently team.bravo.org , load index.htm?? thanks!

assuming mod_alias available on server (just try first , see if works), put in each .htaccess:

redirect permanent / http://team.bravo.org/ 

otherwise, mod_rewrite solution:

rewriterule (.*) http://team.bravo.org/$1 [r=301,l] 

Comments

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -