1

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 assume the passwords in your pastebin are bogus ones. If they're not, you should probably change them right now. – Pat J May 30 '14 at 19:04
  • @PatJ yes, they're not the actual passwords, and this is a local setup. – Nazeem May 30 '14 at 19:45
0

I solved the problem myself.

In the default apache configuration, under /etc/apache2/sites-enabled, where mine is called 15-default.conf

This was declared under the document root:

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

I had to change AllowOverride None to AllowOverride All. Thus you'll get the following:

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

After that, the permalinks started working.

  • where exactly do I find the folders you specified? /etc/apache2/sites-enabled – ProblemsOfSumit Oct 6 '14 at 9:32
  • @Sumit, the directory sites-enabled is to be found on your virtual machine. The file 15-default.conf could be named differently at your machine. But it should have the "-default.conf" part in it – Nazeem Oct 11 '14 at 14:13
0

There's sufficient info on the web about how to get .htaccess files working with Apache2. But specifically with Vagrant, you need to ensure the required settings are implemented in Apache on your guest machine. That might be obvious to everyone else, but I wasted an changing settings on my host and couldn't figure out why it wasn't working.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.