Tiffany B. Brown

A web log about web development and internet culture with frequent detours into other stuff.
JavaScript Holy War: What’s your favorite framework or toolkit?
Recommended: Jeremy Keith’s “Lock up your data”

Comments broken fixed

UPDATE: Comments are now fixed.

About a week or so ago, I added some lines of code to my .htaccess file to redirect all visits from http://tiffanybbrown.com/ to http://www.tiffanybbrown.com/. Making all of your URL requests redirect to one URL (since www and no-www are counted as two separate URLs) cuts down on duplicate content.

Since Google’s algorithm can penalize sites with duplicate content, the less of it you have the better.

The problem, however, is that these lines of rewrite code don’t play nicely with WordPress. Best educated guess as to why? I suspect it’s because every request becomes a GET request once the redirect comes into play. WordPress’s comments form processing script, however, only accepts POST data.

In other words, a POST request to http://yoursite.com/comment-script.php is redirected into a regular GET request for http://www.yoursite.com/comment-script.php, and is therefore disallowed — hence the 405 Method Not Allowed error message you receive when using Internet Explorer to visit the site (Firefox just displayed a blank page).

The offending code:

# redirect all non-www traffic
RewriteCond %{HTTP_HOST} ^tiffanybbrown\.com$
RewriteRule ^.*$ http://www.tiffanybbrown.com%{REQUEST_URI} [R=permanent,L]

Looking into it now. Would discover it on the day I write a comment-seeking post (and not, say, the day before).

Share this entry:
  • TwitThis
  • Digg
  • Technorati
  • del.icio.us
  • Ma.gnolia
  • Mixx
  • NewsVine
  • Reddit
  • StumbleUpon
  • TailRank
  • Furl
  • Slashdot
  • Global Grind
  • YahooMyWeb
  • Facebook
  • Google
  • Live
  • LinkedIn
  • MySpace
Comments are closed.
previous post: JavaScript Holy War: What’s your favorite framework or toolkit?
next post: Recommended: Jeremy Keith’s “Lock up your data”