.htaccess and Wordpress 301 redirects

Discussion in 'Programming' started by banless, Aug 20, 2009.

  1. #1
    This might sound like an odd question but I am just not sure about it. Currently I switched our site to wordpress and needed to do some 301 redirects for the old pages. I installed the "redirection plugin" and it works great. But I have noticed that it changed nothing in my .htaccess file it still looks like this:

    Options +FollowSymLinks

    <IfModule mod_rewrite.c>
    RewriteEngine On

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    # END WordPress

    Doesn't google need to see the actual redirect in the htaccess file in order to transfer all traffic and page rank? I tried placing the redirect in the htaccess like this

    Options +FollowSymLinks
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^onlinemarketingadvisors.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www.onlinemarketingadvisors.com$
    RewriteRule ^Seattle\-Website\-Design\.html$ "http\:\/\/www\.onlinemarketingadvisors\.com\/seattle\-seo\-services\.html" [R=301]

    <IfModule mod_rewrite.c>

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    # END WordPress

    deactivated the plugin and now all I get is the 404 error page. I'm just not sure if the plugin is in fact a real 301 redirect, because I still see the old page in the index but the new page has been cached already so I am a little confused.

    What would be the correct way of writting the access file to make sure that the Search engines are in fact seeing that change?
     
    banless, Aug 20, 2009 IP
  2. premiumscripts

    premiumscripts Peon

    Messages:
    1,062
    Likes Received:
    48
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Show me an old URL and I'll check to see if it's doing the 301 redirect correctly.

    Anyway, google can't even read .htaccess (no one can, it's a private file on your server). The plugin simply does the redirecting via PHP code, not .htaccess - I'm sure it's correct.
     
    premiumscripts, Aug 20, 2009 IP
  3. banless

    banless Peon

    Messages:
    1,745
    Likes Received:
    217
    Best Answers:
    0
    Trophy Points:
    0
    #3
    what your saying makes sense. The 301 is working via the wordpress plugin, if I deactivate it then it stops. I just don't understand how the old page is still showing up in the index, could it be that the spiders just have'nt crawled the page lately, and therefore does not know that it is redirecting?

    one of the old pages is here: http://www.onlinemarketingadvisors.com/Seattle-Website-Design.html
     
    banless, Aug 20, 2009 IP
  4. premiumscripts

    premiumscripts Peon

    Messages:
    1,062
    Likes Received:
    48
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I just checked and it's redirecting just fine via a http 301 response header. Anyway, how long has it been since you made this change? It could probably take up to a month or more for these changes to be represented on google, though to be sure you'd have to ask in the SEO forum.
     
    premiumscripts, Aug 20, 2009 IP
    banless likes this.
  5. banless

    banless Peon

    Messages:
    1,745
    Likes Received:
    217
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Ok, thanks. I added the change about a week ago, normally it doesn't take this long but I guess I'll just be patient and see what happens.
     
    banless, Aug 20, 2009 IP
  6. dcristo

    dcristo Illustrious Member

    Messages:
    19,796
    Likes Received:
    1,201
    Best Answers:
    7
    Trophy Points:
    470
    Articles:
    5
    #6
    Use a redirect checker to make sure it's doing the direction properly.
     
    dcristo, Aug 20, 2009 IP