[HELP] Looking on how can I redirect all my visitors to a solid URL

Discussion in 'Site & Server Administration' started by PinoyEngine™, Apr 4, 2009.

  1. #1
    hi! I am currently hosting a website, mydomainname.com
    Now, I know that spiders and crawlers know that mydomainname.com is different from www.mydomainname.com

    Now, I want every visitors of my sites mydomainname.com or www.mydomainname.com to redirect ONLY to: mydomainname.com

    Maybe not redirect but just to make their address to mydomainname.com

    Now, how can I implement it? Is it in my hosting or in my .htaccess?

    Please help.
    Thanks in advance and more power.

    :cool:
     
    PinoyEngine™, Apr 4, 2009 IP
  2. Camay123

    Camay123 Well-Known Member

    Messages:
    3,423
    Likes Received:
    86
    Best Answers:
    0
    Trophy Points:
    160
    #2
    this code in your htaccess should do the job :

     
    Camay123, Apr 4, 2009 IP
  3. PinoyEngine™

    PinoyEngine™ Well-Known Member

    Messages:
    298
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    145
    #3
    Thank you very much for your reply. And sorry for giving my gratitude late.

    Thank you again.
     
    PinoyEngine™, Apr 4, 2009 IP
  4. peterzeller

    peterzeller Peon

    Messages:
    215
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    You can even do this in Google Webmaster Tools too. In settings, you can select your preferred domain (with or without www). That way, you can be sure Google will index your homepage the way you want it to! :)
     
    peterzeller, Apr 6, 2009 IP
  5. Kaoz

    Kaoz Peon

    Messages:
    767
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Yes, .htaccess does the trick :)
     
    Kaoz, Apr 6, 2009 IP
  6. traian13

    traian13 Peon

    Messages:
    203
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Yeah, you can do this with .htaccess. You can find more info if you search "canonical url htaccess" on google.
     
    traian13, Apr 7, 2009 IP