I have a problem that has caused me a few headaches and I'm hoping maybe someone on here has some light they can share.
I was previously running OS X Mountain Lion with no issues at all with slim framework. Since upgrading to OS X Mountain Lion, I've had nothing but trouble since it rewrites your httpd.conf and other settings. One of which seems to be htaccess. I have vhosts setup and some previously working using slim are now broken on any url other than /
.
So my htaccess file has not changed since upgrading so I'm wondering what the problem is. I'm using the default htaccess as supplied in the slim framework download, I even tried a custom one but to no avail.
Visiting /
produces the required page. Visiting a different URL does this:
Not Found
The requested URL /myurl was not found on this server.
Any one any tips?
mod_rewrite is enabled, and this is what my vhost setup is:
<Directory "/Users/chris/Sites/slimphp/">
Allow From All
AllowOverride All
</Directory>
<VirtualHost *:80>
ServerName "slim.php"
DocumentRoot "/Users/chris/Sites/slimphp"
</VirtualHost>
After some extensive research i found out that it was the server.app from Apple that changed a lot of things. This blog was a life saver for me.
http://petercompernolle.com/2012/07/26/fixing-httpdconf-in-osx-mountainlion
And then several hours later, I figured it out. It's no longer stored at /etc/apache2/httpd.conf. For some reason, Apple has changed something that's worked for a long time, and instead created a whole bunch of files in /Library/Server/Web/Config/apache2/sites. There's a .conf file for anything on port 80, another .conf file for the site I created in Server.app, and a whole bunch of other backups made for every change I made in Server.app.
Check that mod_rewrite is enabled for the apache server, and that AllowOverride FileInfo
(or all
) is enabled for the relevant apache directory section. This will allow .htaccess files to specify rewrite rules.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With