WordPress permalinks not working – htaccess and module rewrite enabled

I’ve set permalinks to /%postname%/, and have updated .htaccess in the root directory. The module rewrite is enabled on my machine (localhost). I can’t think of any other reason why it’s not working. Can anyone help me debug it?

Here’s the logged error:

Read More
127.0.0.1 - - [22/Jan/2014:10:27:57 +0000] "GET /olp/about/ HTTP/1.1" 404 497 "http://localhost/olp/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.66 Safari/537.36"

Edit:

.htaccess:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /olp/
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /olp/index.php [L]
</IfModule>

WP is installed in localhost/olp, and .htaccess is in that same directory.

Edit: more info. In my apache2.conf, I’ve got:

<Directory "/var/www/"> 
Options FollowSymLinks 
AllowOverride All 
Order allow,deny 
Allow from all 
</Directory>

Is this configuration correct?

Related posts

Leave a Reply

3 comments

  1. This is now solved.

    Although in apache.conf, I have AllowOverride All, this wasn’t set in /etc/apache2/sites-available/default. There it had AllowOverride None. So I just changed this, restarted apache and now it works.

  2. Try to clear-up your .htaccess file and than save permalinks again in wp-admin, wordpress will add Rewrite to .htaccess, sometimes it’s helping.

  3. You may need to copy the index.php (or you may first try to skip this one) and the .htaccess from /localhost/olp to /localhost/ dir.

    This advice is according the docs at: http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory

    Usually it is needed when you install it in /localhost and move it to /localhost/olp. But I’m not experienced in installing WP in a subdirectory.

    Another similar questions are available:

    Make sure your .htaccess works!

    And a final tip – as it is a localhost installation, you probably can install it directly in the main document root (then I can help much more).