Forum Moderators: phranque

Message Too Old, No Replies

XAMMP / MAMP on the MAC htaccess directives

can't get FILESMATCH to work on the mac

         

fwitz

3:54 pm on Jan 6, 2008 (gmt 0)

10+ Year Member



Hi, I have a XAMPP installation running on my macbook. The problem I'm experiencing has to do with some htaccess directives. Everything works fine on my windows laptop and on the live site, but I'd just love to get this working on my mac. I've searched high & low on the net for a solution and only get half-baked ideas, none of which are working. I've also tried installing MAMP, but get the same results.

Here's the htaccess file which sits at the root of the site:

Options +FollowSymLinks
php_flag register_globals 0
IndexIgnore */*
DirectoryIndex index.php
<FilesMatch "^(products¦about¦reviews¦news¦workshops¦artists¦downloads¦charities¦search¦con
tact¦terms¦special_offer)$">
SetHandler php-script
ForceType application/x-httpd-php

</FilesMatch>

What it does is enable friendly URLS:: if you browse to site/reviews/, it should execute the php file named "reviews" (no .php) located in site/. Instead, xampp is ignoring this directive and producing a 404 as this directory does not exist. If I leave off the trailing slash, it attempts to download the file rather than executing it according to the directive. I don't want to change the basic method of working with urls in the htaccess file since it works perfectly fine on the live server and my windows laptop (which is NOT using xampp), and the files themselves contain more code for virtual subdirectories. what i'd like to do is see if there is a setting in xampp that needs tweeking ... maybe an httpd conf directive.

i've tried playing around with the httpd.conf and setting everything as loose as possible (security is not an issue in this case) as well as moving the LoadModule rewrite_module modules/mod_rewrite.so directive to above the LoadModule cache_module modules/mod_cache.so (one example of a seemingly halfbaked solution that I found). still no dice.

any help would be much appreciated, thx a lot!

jdMorgan

9:59 pm on Jan 6, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You might want to try again after adding an (optional) trailing slash to the FilesMatch pattern and completely flushing your browser cache:

<FilesMatch "^(products¦about¦<snip>¦terms¦special_off[b]er)/?$">[/b]

Also, note that posting on this forum modifies the pipe characters; You'll need to replace the broken pipe "¦" characters above with solid pipes from your keyboard before use.

Jim