Hey everyone,

I've set up a dev environment on my Mac, and I'm noticing some strange things that I haven't seen before.

When making a request to http://localhost/test, If I have a file in the site folder named

  • test.jpg
  • test.html
  • test.php
  • test.xml

then Apache will fetch the first one it finds.

For example, if only "test.jpg" exists in the folder, then requesting http://localhost/test will render test.jpg in the browser.

Mac OSX is making a "guess" about the file i need, and it's really messing up my mod_rewrite rules because it seems like this guess is being passed through to the rules...

Issue First Seen When:

I setup a mod_rewrite rule to fetch the php version of a css file. If style.css was requested, then it would rewrite to style.css.php

I thought my mod_rewrite was working, because when I requested the file apache was producing the file. But I noticed that the HTTP Headers were not what I expected and AllowOverride was set to None. htaccess wasn't even recognized for the time being.

Question
If anyone knows how I can better tune my mac for development, that would be awesome. Specifically, I need to resolve the issue stated above.

Thanks for your help.

Best Regards,

Mike

Are you using the Apache that comes with OSX? If so, have you tried MAMP?
I know it may be frowned upon but personally I've only ever had trouble with the pre-installed apache.
MAMP has always worked for me well. Just write a script to start the servers on startup and you don't even have to worry about that.

http://www.mamp.info/en/index.html

Thanks for the suggestion... I actually installed MAMP Pro today and it's pretty cool. I like the ease of use for managing vhosts.

MAMP solved the issue that I had right away. One nice thing about MAMP vs Apache on OSX is that MAMP comes with a lot of libraries Mac ommits by default.

I hope someone can still provide a solution though...

Thanks!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.