Wordpress and 301 Redirect

Discussion in 'Apache' started by mikemdg, Nov 28, 2007.

  1. #1
    Hopefully someone can help... I've setup these lines in my .htacess file

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

    This throws all my http://.... url's over to the www version just fine, but for some reason wordpress will not work unless it is at http://mysite.com/blog/

    Is there something I can edit in wordpress to correct this?
    I tried a wordpress redirect plugin, but it didn't do a thing. :confused:
     
    mikemdg, Nov 28, 2007 IP
  2. powerspike

    powerspike Peon

    Messages:
    312
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #2
    RewriteCond %{HTTP_HOST} ^mysite.com [NC]
    RewriteRule ^blog/(.*)$ http://www.mysite.com/blog/$1 [L,R=301]


    maybe that'll help

    if your blog in located in your /blog directory, not sure why it wouldn't be working thou..
    a little puzzling.
     
    powerspike, Nov 28, 2007 IP
  3. mikemdg

    mikemdg Member

    Messages:
    68
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #3
    Won't that redirect let's say: http://mypage.php to http://www.mysite/blog/mypage.php ?

    You're right though... it is weird! :) thanks for the suggestion, I guess I'll just have to figure it out.
     
    mikemdg, Nov 28, 2007 IP
  4. Jean-Luc

    Jean-Luc Peon

    Messages:
    601
    Likes Received:
    30
    Best Answers:
    0
    Trophy Points:
    0
    #4
    In your WordPress admin, look at these lines under "Options":
    - WordPress address (URL)
    - Blog address (URL)

    Jean-Luc
     
    Jean-Luc, Nov 29, 2007 IP
  5. mikemdg

    mikemdg Member

    Messages:
    68
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #5
    Talk about a simple solution. Funny how we overlook the basics sometimes!

    Thanks Jean-Luc!
     
    mikemdg, Nov 29, 2007 IP