WordPress blog is turning up 301 redirect

My WordPress blog seems to be returning a 301 redirect for Googlebot but it seems to be working fine in the browsers. Within Google Webmaster Tools I fetched my site (www.brandculture.com/blog) as Googlebot and this is what was returned:

HTTP/1.1 301 Moved Permanently
Date: Sun, 17 Jan 2010 17:49:46 GMT
Server: Apache/2.0.54
Location: http://www.brandculture.com/blog/
Vary: Accept-Encoding
Content-Encoding: gzip
Content-Length: 242
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: text/html; charset=iso-8859-1

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a href="http://www.brandculture.com/blog/">here</a>.</p>
<hr>
<address>Apache/2.0.54 Server at [www.brandculture.com](http://www.brandculture.com/) Port 80</address>
</body></html>

However, if I view this in the the browser I’m seeing the blog just fine without a redirect of any kind. Why is the server doing this 301?

Here is my .htaccess file:

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

# END WordPress

I forgot about the .htaccess file in the web root. When I commented out this:

#RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\\ /.*index\\.php\\ HTTP/
#RewriteRule ^(.*)index\\.php$ http://www.brandculture.com/$1 [R=301,L]
#AddHandler php5-script .php

The individual pages such as /blog/index.php seem to load without the 301 but /blog still produces a 301. Again, everything works correctly in the browser. It’s just Googlebot that’s seeing this. Here’s the root .htaccess file:

RewriteEngine on

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

#RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\\ /.*index\\.php\\ HTTP/
#RewriteRule ^(.*)index\\.php$ http://www.brandculture.com/$1 [R=301,L]
#AddHandler php5-script .php

Redirect 301 /blog/about http://www.brandculture.com/blog/about-2

Sorry for all the replies - just learning more about this as I go. I’ve just tried the same thing on a completely different domain with the same directory structure and getting the same results. This appears to be more of a WordPress thing. Has anyone ever experienced this before?

Hyper,

The Redirect (301) will take precedence over all mod_rewrite directives.

THAN the non-www to www will also produce a 301 code for you.

The remaining mod_rewrite will not.

What is your TEST URL?

Regards,

DK

I’m testing both:

www.brandculture.com/blog (Googlebot shows 301)
www.brandculture.com/blog/index.php (Googlebot does not show 301)

Hyper,

A closer look:

RewriteEngine on

Options +FollowSymLinks
RewriteCond &#37;{HTTP_HOST} ^brandculture.com$
RewriteRule ^(.*)$ http://www.brandculture.com/$1 [R=301,L]

[COLOR="Gray"]#RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\\ /.*index\\.php\\ HTTP/
#RewriteRule ^(.*)index\\.php$ http://www.brandculture.com/$1 [R=301,L]
#AddHandler php5-script .php

Redirect 301 /blog/about http://www.brandculture.com/blog/about-2[/COLOR]

There’s NOTHING there that even affects blog or blog/index.php. The only “redirection” is Apache recognizing that blog is a directory rather than a file and find the first DirectoryIndex it can (index.php) to serve. I wouldn’t call that a 301 but your bot seems to think otherwise.

Regards,

DK

Thanks David. I didn’t see a 301 in that .htaccess file either but Googlebot seems to be saying otherwise.

I guess I’ll just wing it and see what happens.

-Jeff