Permalinks in WordPress can drive you crazy

Start typing “Permalinks” into Google and you will quickly start seeing links that are relative to WordPress.

The most popular links for permalink help are noted here:

What these wordpress pages don’t say

An exact checklist for checking why your permalinks might not be working.

Pre-requisites: Check Setup –  Linux + Apache + MySQL + PHP

  1. Check to see if default permalinks work.

    YES – Continue to next step
    NO – Continue to step 4

  2. Check your DB (Especially if you have moved or transferred your website from another domain.)

  3. Check your .htaccess file in the root of the wordpress directory.

    White in your root directory, type:

    nano .htaccess

    Screen Shot 2014-04-29 at 2.46.07 AM

  4. Check your server configuration file.

    How: While in your root directory after you SSH through into server, type:

    cd /etc/apache2/sites-available

    – You should see a file with your website name.
    Screen Shot 2014-04-29 at 2.51.06 AMThen type nano {file name}. For me it would be

    nano smartass

    You should then see this screen.
    Screen Shot 2014-04-27 at 8.32.45 PM

  5. Check your file permissions

    How: White in the directory of the file or folder you want to check permissions on, type ls -ld {dir/file name}, for me:

     ls -ld smartass

    Screen Shot 2014-04-27 at 8.34.11 PM

  6. Check that your mod_rewrite module is enabled.

A lot of times you will go through the links when you search and end up going in circles between your WordPress install and backend, crossing your fingers that your permalinks will finally work.  Several resources can be found in a search, but I couldn’t find a defined checklist, so I made this and hope that it can help someone and save them time.

In writing this, I will admit to my mistake or going through several different sites and spending up to 3 hours trying to figure out which problem it was, before finding a short post about enabling the mod_rewrite on the server. And for me, the mod_rewrite being disabled was not allowing the .htaccess file to work properly and thus breaking the permalinks. You can laugh at me because for me, I completely felt like:

Womp womp…. 3 hours wasted on a small thing that should have been standard. Now listed as Step 6.

Lesson learned:

Never assume the default setup has everything you need for your server and WordPress.