I am using Vagrant to build up a little WordPress development VM. When I select permalinks (postname) then the page from an article doesn’t load. However, when I select the standard link (i.e page id) all is working good.
I’ve used the service PuPHPet to build the VM.
My settings can be found here
I am using WordPress 3.9.1 and Apache2
I’ve enabled mod_rewrite be executing:
a2enmod rewrite
And my .htaccess file from WordPress is as follows:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /svisa/
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /svisa/index.php [L]
</IfModule>
# END WordPress
it has the following permissions and ownership:
-rw-rw-rw- 1 vagrant www-data 248 May 30 14:52 .htaccess
My virtualhost file for the site (/var/www/svisa/
) can be found here.
from my host computer, I browse to the site via adress: http://wpdev-vm/svisa/
where wpdev-vm
is the name of the vm.
Does anybody know what I am missing to make the permalinks work?
I solved the problem myself.
In the default apache configuration, under
/etc/apache2/sites-enabled
, where mine is called15-default.conf
This was declared under the document root:
I had to change
AllowOverride None
toAllowOverride All
. Thus you’ll get the following:After that, the permalinks started working.
The (correct) answer above says that you need to change
AllowOverride None
toAllowOverride All
in your xxx-default.conf file found in the /etc/apache2/sites-enabled directory.However, in my vagrant box (precise64) none of the allowOverride or
<Directory /var/www/>...
code was present to begin with in the default.conf file.I ended up having to add all of it between the VirtualHost tags, like below:
And then having to restart apache, like below, for it to work.
sudo service apache2 restart