Enable Pretty Permalinks on WordPress

Set pretty permalinks in Settings

.htaccess file must look like this


# BEGIN WordPress

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

# END WordPress

Enable mod_rewrite on terminal window


a2enmod rewrite

Enable AllowOverride in Apache config file so that Apache reads .htaccess file


<Directory />
    Options FollowSymLinks
    AllowOverride All
</Directory>

<Directory /var/www/html>
    # ... other directives...
    AllowOverride All
</Directory>

Restart Apache server


service apache2 restart

or


/etc/init.d/apache2 restart

Leave a Reply

Your email address will not be published.