I need help please

Discussion in 'Apache' started by CLMMafia, Nov 30, 2011.

  1. #1
    Hello,

    I have a couple of domains parked on top of each other.

    I want to redirect example.com,example.net, example.org to example.com.au using htaccess.

    I would also like to remove the www from the address.

    Thanks
     
    CLMMafia, Nov 30, 2011 IP
  2. kmnn

    kmnn Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    seems no-one here wants to help. I have my question unanswered as well.

    Well what you're trying to do is really simple, if you have a cpanel, just goto redirects and add redirections for all the domain you listed to your preferred domain.

    Simple as that. Cpanel will automatically write the .htaccess code for you.
     
    kmnn, Dec 1, 2011 IP
  3. pr0t0n

    pr0t0n Well-Known Member

    Messages:
    243
    Likes Received:
    10
    Best Answers:
    10
    Trophy Points:
    128
    #3
    To remove a www from your url you can add this to your .htaccess:
    
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^www.example.com$ [NC]
    RewriteRule ^(.*)$ http://example.com/$1 [R=301,L]
    
    Code (markup):
    As for redirection to some other domain name, based on requested domain name, you can try using this code:
    
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^(www\.)?example\.com [NC]
    RewriteRule ^(.*)$ http://someotherdomain.com/$1 [R=301,L]
    
    Code (markup):
     
    pr0t0n, Dec 4, 2011 IP