All posts All posts by this author Paper color Change page color Announcements

Enabling Wordpress Permalinks on Ubuntu

Apache Settings

Enable rewrite module:

~$ sudo a2enmod rewrite

Edit Apache configuration file:

~$ vi /etc/apache2/sites-enabled/000-default

Change AllowOverride None to AllowOverride All

Restart Apache:

~$ sudo service apache2 restart

Wordpress Settings

Settings -> Permalinks

Enable your favorite permalinks and Save Changes. Wordpress will create
.htaccess file and if fails you will see something like-

If your .htaccess file were writable, we could do this automatically, but it isn't
so these are the mod_rewrite rules you should have in your .htaccess file.

Click in the field and press CTRL + a to select all.

<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]

Create .htaccess file to your wordpress root directory (directory containing
wp-admin, wp-content, wp-includes) and save it with the mod_rewrite rules.

Software Solutions