Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Slim Framework .htaccess / mountain lion osx

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>
like image 547
user1496164 Avatar asked Aug 13 '12 09:08

user1496164


2 Answers

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.

like image 111
user1496164 Avatar answered Oct 11 '22 17:10

user1496164


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.

like image 29
Ivo Avatar answered Oct 11 '22 17:10

Ivo