문제

On the root of my hosting account sit two important folders: httpdocs and subdomains
Now in order to silently load page index.htm for all four of the domainvariations (below) I'm stuck in that bits n pieces from other answers don't join up well together to make it 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 the httpdocs folder currently all non-www gets nicely redirected to www using:

RewriteCond %{HTTP_HOST} !^(www\.|$) [NC]
RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

What needs to go to the the first, second and third '.htaccess'file to make all domains to redirect permanently to team.bravo.org and load index.htm?? Thanks!

도움이 되었습니까?

해결책

Assuming mod_alias is available on your server (just try this first and see if it works), you could put this in each .htaccess:

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

Otherwise, this is a mod_rewrite solution:

RewriteRule (.*) http://team.bravo.org/$1 [R=301,L]
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top