The default settings in a clean WordPress install adds this pesky… ‘index.php/’ to all your site links. Personally I find this undesirable, for a number of reasons.
Firstly, it’s just not very SEO friendly… not that I spend much time on things like that. But according to some of my reading, SEO is a very powerful tool indeed. I personally haven’t found a great need to push my site up in front on the search engines… at least yet. But back to this WordPress problem.
Secondly… I just don’t like the way it looks.
So, with all these glaring reasons to trek on in this configuration adventure… that is exactly what I did… and eventually even got it all working out great. Being fairly familiar with this issue, from previous experience with Apache2, PHP, WordPress and the like… I knew right where I needed to go… Straight to the .htaccess file! Apache’s mod_rewrite module is the key here. Which I installed, when I installed the server.
Armed with this knowledge I thought I had already tackled this problem… I fired up my vim text editor. Threw me together a beautifully formatted (if I do say so myself) .htaccess file. I Went into my WordPress Admin, set the Permalinks settings. Then fired off the links, with a smug sense of accomplishment… only to be encountered with a glaring 404. Hmmm…. must be a typo…
Of course after checking and checking… and rechecking… no typos… links just not working…
I check my Apache2 configs to make sure everything is right there… all looks good… while I’m there, I check the Apache vhost configs… OH! There it is… I forgot to set the “AllowOverride” directive to “all”. Quick simple edit… all done. Restart our webserver… check our links… bit less smug this time… but still feeling pretty sure we’ve got this all ironed out…
404…. WTF!!!!
After, a good 2 hours of looking everything over… I finally discover my real mistake… Turns out that apache modules work best if you actually load them. This all would have been done in 5 minutes had I simply remembered… ‘a2enmod rewrite’ ….
Moral of the story… make sure the tools are actually there before you try to use them.