WordPress – Fixing 404 Error After a Permalink Change

I’m running the webserver on Debian for the radio station (using a small VPS provider, absolutely plenty for our needs) but I was having one problem – I would try to change the permalinks from “Default” to “Post Name” and every page or post, not including the front page, would 404.

PermalinkPage

I’d change back to “Default” – the 404 goes away. I started to have a look around and the best walkthrough I found was one by wpbeginner.com but it didn’t work. I was missing one thing in my Apache2 file for wordpress.

/etc/apache2/sites-available/wordpress needed to look like so;

ApacheWP

My AllowOverride was “None” and not “All”. Changing that did the trick! Apache was ignoring my .htaccess file, and thus breaking all the new links.

The .htaccess file at /var/www/wordpress/.htaccess should look like this (mine was always like this, but it doesn’t hurt to check);

htaccess

I did a restart of the VPS, then once everything was back up I went to Dashboard > Settings > Permalinks, made sure “Post Name” was checked and clicked “Save Changes” again. I went to a page with the new permalinks and VoilĂ ! Happy days.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s