Pages

Monday, June 2, 2014

Broken PHP Code : "Allowing Slashes in the URL Path With Apache"

I had a problem where I needed to pass an LDAP URL with two forward slashes 


ldaps://ldap.blah.com
in some PHP code. I couldn't get it to work but I found out how to fix it: 

I had to configure Apache to allow encoded slashes with AllowEncodedSlashes Onin the relevant vhost by adding :
<VirtualHost 127.0.0.1:80>
       AllowEncodedSlashes On
    # ...
</VirtualHost>
Into the /etc/apache2/apache2.conf config file. I then ran 
sudo service apache2 restart
And the problem was fixed.

No comments:

Post a Comment