one more www redirect thread

Discussion in 'Site & Server Administration' started by jacksmith, Aug 28, 2006.

  1. #1
    Hi guys,

    I wanted to redirect my non-www url to www url which I was able to do it successfully with following code I found here on DP

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


    But there is one small problem. I have a wordpress blog. And when someone visits my blog with old link which looks like http:// mydomain.com/how-i-started-blogging/ he gets redirected to my home page http:// mydomain.com and not to http:// www.mydomain.com/how-i-started-blogging/

    any suggestions?

    Jack
     
    jacksmith, Aug 28, 2006 IP
  2. vishwaa

    vishwaa Well-Known Member

    Messages:
    271
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    138
    #2
    Try this code and let us know if you still have problem.

     
    vishwaa, Aug 29, 2006 IP
  3. jacksmith

    jacksmith Peon

    Messages:
    1,013
    Likes Received:
    27
    Best Answers:
    0
    Trophy Points:
    0
    #3
    yes I tried it already! but it doesn't work :(
     
    jacksmith, Aug 29, 2006 IP