Scriptim
Scriptim

Reputation: 1832

Wordpress: Page not found - Permalink postname

This is a frequently asked question, but after searching for hours I couldn't find any solution that worked for me. So, here's my problem:

When I change my permalinks setting to 'postname' I get a 404 Error when I navigate to a page. I works with the default setting and when I put index.php before 'postname' (like this: http://localhost/wordpress/index.php/%postname%). But this is pretty ugly and bad for SEO.

My local wordpress installation is here: /var/www/html/wordpress/, so I can reach the wordpress homepage at http://localhost/wordpress/index.php

I'm running Debian Jessie and WordPress 4.5.3

This is my htacces file automatically created by Wordpress (/var/www/html/wordpress/.htaccess). Permission are set to 664.

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

# END WordPress

The Apache Rewrite module is enabled (sudo a2enmod rewrite)

Upvotes: 1

Views: 2949

Answers (1)

Arif
Arif

Reputation: 563

Try This :

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /wordpress/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wordpress/index.php [L]
</IfModule>
# END WordPress

EDIT
In your /etc/apache2/apache2.conf change

<Directory /var/www/>
        Options Indexes FollowSymLinks
        AllowOverride None
        Require all granted
</Directory>

to

<Directory /var/www/>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
</Directory>

Upvotes: 1

Related Questions