Archived posts from this Category

Howto: Fix WordPress 2.6 broken permalinks

Posted by on 28 Jul 2008 | Tagged as: Howto, tech, Wordpress

So you run your own server and have your blog on it.  The wp-admin dashboard told you to upgrade to wordpress 2.6 and since you did that, none of your permalinks work because they looked like:


Of course, that makes you mad as that breaks all your google indexes and facebook imported notes.

Fear not! The fix is simple.  Just go to the wp-admin page, choose “settings” (top right of the screen), then “Permalinks” and choose “Day and Name”, hit save and it should look like:

Dont worry if you cant see this, it isnt all that important

So if it looks like the above, test it out and you should be good.

If it says “You should update your .htaccess now” then you need to do this:

(Assuming you have shell access on your server)

  • cd into the directory that houses your wordpress
  • touch .htaccess
  • chmod 666 .htaccess
  • Go back to the admin page and save the changes (it should now say “Permalink structure updated”)
  • chmod 644 .htaccess

Now, go and test one of the permalinks from the main page of your blog.  It should work now, if you get a 404, you need to edit your apache config.  You’ll need to edit your httpd.conf (or /etc/apache2/sites-available/ file if you’re on Debian or Ubuntu) and add the lines in bold below

<VirtualHost *:80>
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot /var/www/html/lamespotting.com
ServerName lamespotting.com
ServerAlias www.lamespotting.com
Options FollowSymLinks
<Directory />
AllowOverride FileInfo

ErrorLog logs/lamespotting-error_log
CustomLog logs/lamespotting-access_log combined

You should now be in business.  If you can’t access your httpd.conf, then the problem may be with the .htaccess file.  Check with your web host provider (if it isn’t your server) about being able to edit the .htaccess file, which should look like:

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