Thursday, 12 September 2013

Enabling pretty permalinks on Wordpress - apache configuration does not work

Enabling pretty permalinks on Wordpress - apache configuration does not work

Probably this error has a pretty easy solution but I've been looking way
to long at this and still don't get the error. I think I've tried whatever
I could.
Problem: when I enable pretty permalinks on my wordpress installation (so,
that it is using /%postname%/), it doesn't work. I get a 404 on all pages
except for the homepage.
This page http://codex.wordpress.org/Permalinks tells me the requirements
for permalinks to work:
Apache web server with the mod_rewrite module installed
In WordPress's home directory,
The FollowSymLinks option enabled
FileInfo directives allowed (e.g. AllowOverride FileInfo or AllowOverride
All)
An .htaccess file (if this file is missing, WordPress will try to create
it when you activate "pretty" permalinks)
If you want WordPress to update the .htaccess file automatically,
WordPress will need write access to the file.
Apache web server has been installed, the mod_rewrite module has been
loaded with a2enmod rewrite command (and the server has been restarted
multiple times after). So, under /etc/apache2/mods-enabled, the symlink to
rewrite.load is present. Also, when I run phpinfo command, I see that the
mod_rewrite module has been loaded. You can check this as well here:
http://namorti.com/phpinfo.php
Then, in /etc/apache2/sites-enabled, there was no "default" present. I
copied 000-default.conf to default and edited default afterwards. It
contains the following: DocumentRoot /var/www
<Directory />
Options FollowSymLinks Indexes
AllowOverride FileInfo
</Directory>
So as far as I'm concerned, FollowSymLinks has been enabled and FileInfo
directives are allowed.
As for the last two points, in my wordpress home directory (/var/www),
.htaccess is present and writeable by Wordpress (I updated the permalink
structure a couple of times and it updates the .htaccess file
accordingly). Right now it contains the following:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
So, as far as I know, it SHOULD be working. I restarted the server
(service apache2 restart) several times. I don't see what I'm missing.
Anyone has a clue here?
Thanks in advance!

No comments:

Post a Comment