How to get my site url as www.mysite.com instead of mysite.com using .htaccess

Discussion in 'Apache' started by anildewani, Feb 22, 2009.

  1. #1
    Hello all,

    I am facing a bit of trouble.
    I have recently brought a domain and have added the domain as an Add-on domain on my hosting.

    When i try to access my website using www . mywebsite . com, i get redirected to mywebsite . com

    even search engines does not show www. for my website.
    I have tried google to find solution, and came to know, it is possible using .htaccess

    well, i am new to .htaccess, A help would be really appreciated ! :)

    Thanks a lot in advance.
    Looking forward to your response.


    EDIT :
    I tried the ways given on this link and this link

    After editing the .htaccess file.
    I get an error as follows, while accessing my webiste (though i get redirected to www. mywebsite . com , as per the address bar)
    Can anyone sort it out ?
    I also tried redirection using cpanel with wild card, but had the same problem !

    - Anil.
     
    anildewani, Feb 22, 2009 IP
  2. kailash

    kailash Well-Known Member

    Messages:
    1,248
    Likes Received:
    42
    Best Answers:
    0
    Trophy Points:
    190
    #2
    Do you have installed wordpress or any other third party script in the root of your addon domain ?

    Kailash
     
    kailash, Feb 22, 2009 IP
  3. anildewani

    anildewani Peon

    Messages:
    1,132
    Likes Received:
    66
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Yes, i have installed wordpress. :)
     
    anildewani, Feb 22, 2009 IP
  4. tolra

    tolra Active Member

    Messages:
    515
    Likes Received:
    36
    Best Answers:
    1
    Trophy Points:
    80
    #4
    Log in to the admin of WordPress and in settings check the URLs are entered with the www, if not change them both to be www.yoursite.com
     
    tolra, Feb 22, 2009 IP
  5. anildewani

    anildewani Peon

    Messages:
    1,132
    Likes Received:
    66
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Thanks a lot. It worked.
    I did a Rep+ for you. :)
     
    anildewani, Feb 22, 2009 IP