Suffix rewriting - www.domain.com > www.domain.com.au

Discussion in 'Apache' started by Kerosene, Dec 11, 2005.

  1. #1
    I have www.mydomain.com and www.mydomain.com.au

    Both these domains also work without the "www".

    I'm trying make it so:

    -www.mydomain.com
    -www.mydomain.com.au
    -mydomain.com
    -mydomain.com.au

    all rewrite to "www.mydomain.com.au"



    Everything works except rewriting www.mydomain.com to www.mydomain.com.au

    My .htaccess :
    
    RewriteCond %{HTTP_HOST} ^mydomain.com.au [NC] 
    RewriteRule ^(.*)$ http://www.mydomain.com.au/$1 [L,R=301] 
    
    RewriteCond %{HTTP_HOST} ^mydomain.com [NC] 
    RewriteRule ^(.*)$ http://www.mydomain.com.au/$1 [L,R=301] 
    
    RewriteCond %{HTTP_HOST} ^www.mydomain.com [NC] 
    RewriteRule ^(.*)$ http://www.mydomain.com.au/$1 [L,R=301] 
    Code (markup):
    Please tell me the obvious mistake that I'm making. Whenever I add the last 2 lines it screws up and my site point nowhere.
    And also, will this actually benefit my Google ranking/pagerank?

    I just can't get my head around htaccess, no matter how much I try :eek:
     
    Kerosene, Dec 11, 2005 IP