Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

How to get .htaccess URL rewriting working with the preinstalled apache2?

I've tried and tried to get this to work. I'm switching from windows to this macbook, and for the life of me, I can't get my .htaccess file to work with the URL rewriting. It's like the server isn't even recognizing that it's there. This is what I got in the .htaccess:

RewriteEngine on
RewriteRule ^games/$ index\.php\?action\=games
RewriteRule ^games$ index\.php\?action\=games
RewriteRule ^events/$ index\.php\?action\=events
RewriteRule ^events$ index\.php\?action\=events
RewriteRule ^downloads/$ index\.php\?action\=downloads
RewriteRule ^downloads$ index\.php\?action\=downloads
RewriteRule ^support/$ index\.php\?action\=support
RewriteRule ^support$ index\.php\?action\=support
RewriteRule ^blogs/$ wordpress/
RewriteRule ^blogs$ wordpress/

By all means it should be working, save for the fact that it's not even being read by Apache! In /private/etc/apache2/httpd.conf I edited every instance of AllowOverride None and changed it to AllowOverride All and it still will not work! I also went to /private/etc/apache2/users/achilleus/.conf and did the same in that file as well. For the life of me, when I go to http://localhost/index.php?action=games it works but when I go to http://localhost/games/ it refuses to cooperate. I looked in the error log for apache and it doesn't list anything, neither does the access log. I've been on Google for hours and I still can't find anything.

Can somebody please tell me how to enable the use of .htaccess files in a brand new installation of Leopard? I formatted this thing yesterday and ran all the updates.

MacBook, Mac OS X (10.5.4), switching from windows xp pro

Posted on Jul 29, 2008 11:19 AM

Reply
32 replies

Jul 29, 2008 3:11 PM in response to Achilleus

RewriteEngine on
RewriteRule ^games(/)?$ games\.html
#RewriteRule ^games(/)?$ index\.php\?action\=games
#RewriteRule ^events(/)?$ index\.php\?action\=events
#RewriteRule ^downloads(/)?$ index\.php\?action\=downloads
#RewriteRule ^support(/)?$ index\.php\?action\=support
#RewriteRule ^blogs(/)?$ wordpress/

That's my new .htaccess file. I have all the php files commented out until we can figure out why it's adding a trailing slash at the end of games.html

Jul 29, 2008 3:34 PM in response to orangekay

orangekay wrote:
I don't see that happening, either. Run this in Terminal and post the results:

diff -wBy --suppress-common-lines /etc/apache2/httpd.conf /etc/apache2/original/httpd.conf

sh-3.2# diff -wBy --suppress-common-lines /etc/apache2/httpd.conf /etc/apache2/original/httpd.conf
# with "/", the value of ServerRoot is prepended -- so "/priv | # with "/", the value of ServerRoot is prepended -- so "/priv
# server as "/usr//private/var/log/apache2/foo.log". | # server as "/usr//private/var/log/apache2/foo_log".
> LoadModule substitute_module libexec/apache2/mod_substitute.s
#LoadModule uniqueidmodule libexec/apache2/moduniqueid.so | LoadModule uniqueidmodule libexec/apache2/moduniqueid.so
LoadModule bonjour_module libexec/apache2/mod_bonjour.so <
LoadModule php5_module libexec/apache2/libphp5.so <
#LoadModule fastcgi_module libexec/apache2/mod_fastcgi.so <IfModule !mpmwinntmodule>
>
> </IfModule>
ServerAdmin admin@localhost | ServerAdmin you@example.com
AllowOverride All | AllowOverride None
Allow from all | Deny from all
RewriteLog /var/log/apache2/rewrite.log <
RewriteLogLevel 9 <
<
Options All Indexes FollowSymLinks MultiViews | Options Indexes FollowSymLinks MultiViews
RewriteEngine On |
AllowOverride All | AllowOverride None
ErrorLog /private/var/log/apache2/error_log | ErrorLog "/private/var/log/apache2/error_log"
CustomLog /private/var/log/apache2/access_log common | CustomLog "/private/var/log/apache2/access_log" common
#CustomLog /private/var/log/apache2/access_log combined | #CustomLog "/private/var/log/apache2/access_log" combined


There's the results. It is adding a trailing slash at the end of games.html, that's what the 404 page is telling me that it can't find.

Message was edited by: Achilleus

Message was edited by: Achilleus

Jul 29, 2008 4:07 PM in response to Achilleus

Now this is strange...it's trying to find games.html/ again even after uncommenting that line in .htaccess and dumping my cache in Safari. I even restarted apache.

RewriteEngine on
#RewriteRule ^games(/)?$ games.html [L]
RewriteRule ^games(/)?$ index.php?action=games [L]
#RewriteRule ^events(/)?$ index.php?action=events [L]
#RewriteRule ^downloads(/)?$ index.php?action=downloads [L]
#RewriteRule ^support(/)?$ index.php?action=support [L]
#RewriteRule ^blogs(/)?$ wordpress/ [L]


Tuesday, July 29, 2008 5:59:44 PM US/Central 
::1 - - [29/Jul/2008:17:59:47 --0500] [localhost/sid#10080b708][rid#10096c898/subreq] (3) [perdir /Library/WebServer/Documents> add path info postfix: /Library/WebServer/Documents/games.html -> /Library/WebServer/Documents/games.html/
::1 - - [29/Jul/2008:17:59:47 --0500] [localhost/sid#10080b708][rid#10096c898/subreq] (3) [perdir /Library/WebServer/Documents> strip per-dir prefix: /Library/WebServer/Documents/games.html/ -> games.html/
::1 - - [29/Jul/2008:17:59:47 --0500] [localhost/sid#10080b708][rid#10096c898/subreq] (3) [perdir /Library/WebServer/Documents> applying pattern '^games(/)?$' to uri 'games.html/'
::1 - - [29/Jul/2008:17:59:47 --0500] [localhost/sid#10080b708][rid#10096c898/subreq] (1) [perdir /Library/WebServer/Documents> pass through /Library/WebServer/Documents/games.html
::1 - - [29/Jul/2008:17:59:47 --0500] [localhost/sid#10080b708][rid#100978898/subreq] (3) [perdir /Library/WebServer/Documents> add path info postfix: /Library/WebServer/Documents/games.php -> /Library/WebServer/Documents/games.php/
::1 - - [29/Jul/2008:17:59:47 --0500] [localhost/sid#10080b708][rid#100978898/subreq] (3) [perdir /Library/WebServer/Documents> strip per-dir prefix: /Library/WebServer/Documents/games.php/ -> games.php/
::1 - - [29/Jul/2008:17:59:47 --0500] [localhost/sid#10080b708][rid#100978898/subreq] (3) [perdir /Library/WebServer/Documents> applying pattern '^games(/)?$' to uri 'games.php/'
::1 - - [29/Jul/2008:17:59:47 --0500] [localhost/sid#10080b708][rid#100978898/subreq] (1) [perdir /Library/WebServer/Documents> pass through /Library/WebServer/Documents/games.php
::1 - - [29/Jul/2008:17:59:47 --0500] [localhost/sid#10080b708][rid#10097a898/subreq] (3) [perdir /Library/WebServer/Documents> add path info postfix: /Library/WebServer/Documents/games.template.php -> /Library/WebServer/Documents/games.template.php/
::1 - - [29/Jul/2008:17:59:47 --0500] [localhost/sid#10080b708][rid#10097a898/subreq] (3) [perdir /Library/WebServer/Documents> strip per-dir prefix: /Library/WebServer/Documents/games.template.php/ -> games.template.php/
::1 - - [29/Jul/2008:17:59:47 --0500] [localhost/sid#10080b708][rid#10097a898/subreq] (3) [perdir /Library/WebServer/Documents> applying pattern '^games(/)?$' to uri 'games.template.php/'
::1 - - [29/Jul/2008:17:59:47 --0500] [localhost/sid#10080b708][rid#10097a898/subreq] (1) [perdir /Library/WebServer/Documents> pass through /Library/WebServer/Documents/games.template.php
::1 - - [29/Jul/2008:17:59:47 --0500] [localhost/sid#10080b708][rid#10097e898/initial] (3) [perdir /Library/WebServer/Documents> add path info postfix: /Library/WebServer/Documents/games.html -> /Library/WebServer/Documents/games.html/
::1 - - [29/Jul/2008:17:59:47 --0500] [localhost/sid#10080b708][rid#10097e898/initial] (3) [perdir /Library/WebServer/Documents> strip per-dir prefix: /Library/WebServer/Documents/games.html/ -> games.html/
::1 - - [29/Jul/2008:17:59:47 --0500] [localhost/sid#10080b708][rid#10097e898/initial] (3) [perdir /Library/WebServer/Documents> applying pattern '^games(/)?$' to uri 'games.html/'
::1 - - [29/Jul/2008:17:59:47 --0500] [localhost/sid#10080b708][rid#10097e898/initial] (1) [perdir /Library/WebServer/Documents> pass through /Library/WebServer/Documents/games.html
::1 - - [29/Jul/2008:17:59:47 --0500] [localhost/sid#10080b708][rid#100983498/initial] (3) [perdir /Library/WebServer/Documents> strip per-dir prefix: /Library/WebServer/Documents/favicon.ico -> favicon.ico
::1 - - [29/Jul/2008:17:59:47 --0500] [localhost/sid#10080b708][rid#100983498/initial] (3) [perdir /Library/WebServer/Documents> applying pattern '^games(/)?$' to uri 'favicon.ico'
::1 - - [29/Jul/2008:17:59:47 --0500] [localhost/sid#10080b708][rid#100983498/initial] (1) [perdir /Library/WebServer/Documents> pass through /Library/WebServer/Documents/favicon.ico


That's my info that comes up on the rewrite_log and it still doesn't look right. Works if I have the top line uncommented and goes to games.html, but if I use the second line which is what I actually need working, it's all completely screwed up.

After removing games.html from the documents folder, this is the new log I get:

Tuesday, July 29, 2008 6:04:51 PM US/Central 
::1 - - [29/Jul/2008:18:04:54 --0500] [localhost/sid#10080b708][rid#100983498/subreq] (3) [perdir /Library/WebServer/Documents> add path info postfix: /Library/WebServer/Documents/games.php -> /Library/WebServer/Documents/games.php/
::1 - - [29/Jul/2008:18:04:54 --0500] [localhost/sid#10080b708][rid#100983498/subreq] (3) [perdir /Library/WebServer/Documents> strip per-dir prefix: /Library/WebServer/Documents/games.php/ -> games.php/
::1 - - [29/Jul/2008:18:04:54 --0500] [localhost/sid#10080b708][rid#100983498/subreq] (3) [perdir /Library/WebServer/Documents> applying pattern '^games(/)?$' to uri 'games.php/'
::1 - - [29/Jul/2008:18:04:54 --0500] [localhost/sid#10080b708][rid#100983498/subreq] (1) [perdir /Library/WebServer/Documents> pass through /Library/WebServer/Documents/games.php
::1 - - [29/Jul/2008:18:04:54 --0500] [localhost/sid#10080b708][rid#100975898/subreq] (3) [perdir /Library/WebServer/Documents> add path info postfix: /Library/WebServer/Documents/games.template.php -> /Library/WebServer/Documents/games.template.php/
::1 - - [29/Jul/2008:18:04:54 --0500] [localhost/sid#10080b708][rid#100975898/subreq] (3) [perdir /Library/WebServer/Documents> strip per-dir prefix: /Library/WebServer/Documents/games.template.php/ -> games.template.php/
::1 - - [29/Jul/2008:18:04:54 --0500] [localhost/sid#10080b708][rid#100975898/subreq] (3) [perdir /Library/WebServer/Documents> applying pattern '^games(/)?$' to uri 'games.template.php/'
::1 - - [29/Jul/2008:18:04:54 --0500] [localhost/sid#10080b708][rid#100975898/subreq] (1) [perdir /Library/WebServer/Documents> pass through /Library/WebServer/Documents/games.template.php
::1 - - [29/Jul/2008:18:04:54 --0500] [localhost/sid#10080b708][rid#10096e898/initial] (3) [perdir /Library/WebServer/Documents> add path info postfix: /Library/WebServer/Documents/games.php -> /Library/WebServer/Documents/games.php/
::1 - - [29/Jul/2008:18:04:54 --0500] [localhost/sid#10080b708][rid#10096e898/initial] (3) [perdir /Library/WebServer/Documents> strip per-dir prefix: /Library/WebServer/Documents/games.php/ -> games.php/
::1 - - [29/Jul/2008:18:04:54 --0500] [localhost/sid#10080b708][rid#10096e898/initial] (3) [perdir /Library/WebServer/Documents> applying pattern '^games(/)?$' to uri 'games.php/'
::1 - - [29/Jul/2008:18:04:54 --0500] [localhost/sid#10080b708][rid#10096e898/initial] (1) [perdir /Library/WebServer/Documents> pass through /Library/WebServer/Documents/games.php
::1 - - [29/Jul/2008:18:04:54 --0500] [localhost/sid#10080b708][rid#100970898/subreq] (3) [perdir /Library/WebServer/Documents> strip per-dir prefix: /Library/WebServer/Documents/ ->
::1 - - [29/Jul/2008:18:04:54 --0500] [localhost/sid#10080b708][rid#100970898/subreq] (3) [perdir /Library/WebServer/Documents> applying pattern '^games(/)?$' to uri ''
::1 - - [29/Jul/2008:18:04:54 --0500] [localhost/sid#10080b708][rid#100970898/subreq] (1) [perdir /Library/WebServer/Documents> pass through /Library/WebServer/Documents/
::1 - - [29/Jul/2008:18:04:54 --0500] [localhost/sid#10080b708][rid#10097a898/subreq] (3) [perdir /Library/WebServer/Documents> strip per-dir prefix: /Library/WebServer/Documents/index.html -> index.html
::1 - - [29/Jul/2008:18:04:54 --0500] [localhost/sid#10080b708][rid#10097a898/subreq] (3) [perdir /Library/WebServer/Documents> applying pattern '^games(/)?$' to uri 'index.html'
::1 - - [29/Jul/2008:18:04:54 --0500] [localhost/sid#10080b708][rid#10097a898/subreq] (1) [perdir /Library/WebServer/Documents> pass through /Library/WebServer/Documents/index.html
::1 - - [29/Jul/2008:18:04:54 --0500] [localhost/sid#10080b708][rid#100985498/subreq] (3) [perdir /Library/WebServer/Documents> strip per-dir prefix: /Library/WebServer/Documents/index.html -> index.html
::1 - - [29/Jul/2008:18:04:54 --0500] [localhost/sid#10080b708][rid#100985498/subreq] (3) [perdir /Library/WebServer/Documents> applying pattern '^games(/)?$' to uri 'index.html'
::1 - - [29/Jul/2008:18:04:54 --0500] [localhost/sid#10080b708][rid#100985498/subreq] (1) [perdir /Library/WebServer/Documents> pass through /Library/WebServer/Documents/index.html
::1 - - [29/Jul/2008:18:04:54 --0500] [localhost/sid#10080b708][rid#10097a898/subreq] (3) [perdir /Library/WebServer/Documents> strip per-dir prefix: /Library/WebServer/Documents/index.php -> index.php
::1 - - [29/Jul/2008:18:04:54 --0500] [localhost/sid#10080b708][rid#10097a898/subreq] (3) [perdir /Library/WebServer/Documents> applying pattern '^games(/)?$' to uri 'index.php'
::1 - - [29/Jul/2008:18:04:54 --0500] [localhost/sid#10080b708][rid#10097a898/subreq] (1) [perdir /Library/WebServer/Documents> pass through /Library/WebServer/Documents/index.php
::1 - - [29/Jul/2008:18:04:54 --0500] [localhost/sid#10080b708][rid#10096c898/initial] (3) [perdir /Library/WebServer/Documents> strip per-dir prefix: /Library/WebServer/Documents/favicon.ico -> favicon.ico
::1 - - [29/Jul/2008:18:04:54 --0500] [localhost/sid#10080b708][rid#10096c898/initial] (3) [perdir /Library/WebServer/Documents> applying pattern '^games(/)?$' to uri 'favicon.ico'
::1 - - [29/Jul/2008:18:04:54 --0500] [localhost/sid#10080b708][rid#10096c898/initial] (1) [perdir /Library/WebServer/Documents> pass through /Library/WebServer/Documents/favicon.ico


Very strange, considering that I don't even have an index.html file in the folder.

Jul 29, 2008 4:12 PM in response to Achilleus

Gosh, it's obvious when you look, isn't it.

It's not a problem with .htaccess at all. Your RewriteRules are the issue.

RewriteRule ^games/$ index\.php\?action\=games


This says "rewrite any URI that matches "games/"

This will never work. Ever.

Every URI begins with a leading /
Therefore the correct Rule would be:

RewriteRule ^/games/$ index\.php\?action\=games


In other words, match '/games/', not 'games/'

That leading slash is critical.

(and sorry about the RewriteLogs - I did say they'd get verbose 🙂

Jul 29, 2008 4:16 PM in response to Camelot

Tuesday, July 29, 2008 6:13:33 PM US/Central 
::1 - - [29/Jul/2008:18:13:38 --0500] [localhost/sid#10080b708][rid#100978898/subreq] (3) [perdir /Library/WebServer/Documents> add path info postfix: /Library/WebServer/Documents/games.php -> /Library/WebServer/Documents/games.php/
::1 - - [29/Jul/2008:18:13:38 --0500] [localhost/sid#10080b708][rid#100978898/subreq] (3) [perdir /Library/WebServer/Documents> strip per-dir prefix: /Library/WebServer/Documents/games.php/ -> games.php/
::1 - - [29/Jul/2008:18:13:38 --0500] [localhost/sid#10080b708][rid#100978898/subreq] (3) [perdir /Library/WebServer/Documents> applying pattern '^/games(/)?$' to uri 'games.php/'
::1 - - [29/Jul/2008:18:13:38 --0500] [localhost/sid#10080b708][rid#100978898/subreq] (1) [perdir /Library/WebServer/Documents> pass through /Library/WebServer/Documents/games.php
::1 - - [29/Jul/2008:18:13:38 --0500] [localhost/sid#10080b708][rid#10097a898/subreq] (3) [perdir /Library/WebServer/Documents> add path info postfix: /Library/WebServer/Documents/games.template.php -> /Library/WebServer/Documents/games.template.php/
::1 - - [29/Jul/2008:18:13:38 --0500] [localhost/sid#10080b708][rid#10097a898/subreq] (3) [perdir /Library/WebServer/Documents> strip per-dir prefix: /Library/WebServer/Documents/games.template.php/ -> games.template.php/
::1 - - [29/Jul/2008:18:13:38 --0500] [localhost/sid#10080b708][rid#10097a898/subreq] (3) [perdir /Library/WebServer/Documents> applying pattern '^/games(/)?$' to uri 'games.template.php/'
::1 - - [29/Jul/2008:18:13:38 --0500] [localhost/sid#10080b708][rid#10097a898/subreq] (1) [perdir /Library/WebServer/Documents> pass through /Library/WebServer/Documents/games.template.php
::1 - - [29/Jul/2008:18:13:38 --0500] [localhost/sid#10080b708][rid#10096c898/initial] (3) [perdir /Library/WebServer/Documents> add path info postfix: /Library/WebServer/Documents/games.php -> /Library/WebServer/Documents/games.php/
::1 - - [29/Jul/2008:18:13:38 --0500] [localhost/sid#10080b708][rid#10096c898/initial] (3) [perdir /Library/WebServer/Documents> strip per-dir prefix: /Library/WebServer/Documents/games.php/ -> games.php/
::1 - - [29/Jul/2008:18:13:38 --0500] [localhost/sid#10080b708][rid#10096c898/initial] (3) [perdir /Library/WebServer/Documents> applying pattern '^/games(/)?$' to uri 'games.php/'
::1 - - [29/Jul/2008:18:13:38 --0500] [localhost/sid#10080b708][rid#10096c898/initial] (1) [perdir /Library/WebServer/Documents> pass through /Library/WebServer/Documents/games.php
::1 - - [29/Jul/2008:18:13:38 --0500] [localhost/sid#10080b708][rid#10097c898/subreq] (3) [perdir /Library/WebServer/Documents> strip per-dir prefix: /Library/WebServer/Documents/ ->
::1 - - [29/Jul/2008:18:13:38 --0500] [localhost/sid#10080b708][rid#10097c898/subreq] (3) [perdir /Library/WebServer/Documents> applying pattern '^/games(/)?$' to uri ''
::1 - - [29/Jul/2008:18:13:38 --0500] [localhost/sid#10080b708][rid#10097c898/subreq] (1) [perdir /Library/WebServer/Documents> pass through /Library/WebServer/Documents/
::1 - - [29/Jul/2008:18:13:38 --0500] [localhost/sid#10080b708][rid#10097e898/subreq] (3) [perdir /Library/WebServer/Documents> strip per-dir prefix: /Library/WebServer/Documents/index.html -> index.html
::1 - - [29/Jul/2008:18:13:38 --0500] [localhost/sid#10080b708][rid#10097e898/subreq] (3) [perdir /Library/WebServer/Documents> applying pattern '^/games(/)?$' to uri 'index.html'
::1 - - [29/Jul/2008:18:13:38 --0500] [localhost/sid#10080b708][rid#10097e898/subreq] (1) [perdir /Library/WebServer/Documents> pass through /Library/WebServer/Documents/index.html
::1 - - [29/Jul/2008:18:13:38 --0500] [localhost/sid#10080b708][rid#100982898/subreq] (3) [perdir /Library/WebServer/Documents> strip per-dir prefix: /Library/WebServer/Documents/index.html -> index.html
::1 - - [29/Jul/2008:18:13:38 --0500] [localhost/sid#10080b708][rid#100982898/subreq] (3) [perdir /Library/WebServer/Documents> applying pattern '^/games(/)?$' to uri 'index.html'
::1 - - [29/Jul/2008:18:13:38 --0500] [localhost/sid#10080b708][rid#100982898/subreq] (1) [perdir /Library/WebServer/Documents> pass through /Library/WebServer/Documents/index.html
::1 - - [29/Jul/2008:18:13:38 --0500] [localhost/sid#10080b708][rid#10097e898/subreq] (3) [perdir /Library/WebServer/Documents> strip per-dir prefix: /Library/WebServer/Documents/index.php -> index.php
::1 - - [29/Jul/2008:18:13:38 --0500] [localhost/sid#10080b708][rid#10097e898/subreq] (3) [perdir /Library/WebServer/Documents> applying pattern '^/games(/)?$' to uri 'index.php'
::1 - - [29/Jul/2008:18:13:38 --0500] [localhost/sid#10080b708][rid#10097e898/subreq] (1) [perdir /Library/WebServer/Documents> pass through /Library/WebServer/Documents/index.php
::1 - - [29/Jul/2008:18:13:38 --0500] [localhost/sid#10080b708][rid#100975898/initial] (3) [perdir /Library/WebServer/Documents> strip per-dir prefix: /Library/WebServer/Documents/favicon.ico -> favicon.ico
::1 - - [29/Jul/2008:18:13:38 --0500] [localhost/sid#10080b708][rid#100975898/initial] (3) [perdir /Library/WebServer/Documents> applying pattern '^/games(/)?$' to uri 'favicon.ico'
::1 - - [29/Jul/2008:18:13:38 --0500] [localhost/sid#10080b708][rid#100975898/initial] (1) [perdir /Library/WebServer/Documents> pass through /Library/WebServer/Documents/favicon.ico


That's the log I get when I make your suggested change. Not even a 404 this time, just a blank white page. It worked just fine without the leading slash on my windows apache. The problem is the TRAILING slash that it's adding to my php files, and I have no clue why it's looking for an index.html because it's not even being requested.

Jul 29, 2008 4:36 PM in response to orangekay

Either way, with or without the backslashes, it still won't work.

Tuesday, July 29, 2008 6:35:16 PM US/Central 
::1 - - [29/Jul/2008:18:35:20 --0500] [localhost/sid#10080b708][rid#100978898/subreq] (3) [perdir /Library/WebServer/Documents> add path info postfix: /Library/WebServer/Documents/games.php -> /Library/WebServer/Documents/games.php/
::1 - - [29/Jul/2008:18:35:20 --0500] [localhost/sid#10080b708][rid#100978898/subreq] (3) [perdir /Library/WebServer/Documents> strip per-dir prefix: /Library/WebServer/Documents/games.php/ -> games.php/
::1 - - [29/Jul/2008:18:35:20 --0500] [localhost/sid#10080b708][rid#100978898/subreq] (3) [perdir /Library/WebServer/Documents> applying pattern '^/games(/)?$' to uri 'games.php/'
::1 - - [29/Jul/2008:18:35:20 --0500] [localhost/sid#10080b708][rid#100978898/subreq] (1) [perdir /Library/WebServer/Documents> pass through /Library/WebServer/Documents/games.php
::1 - - [29/Jul/2008:18:35:20 --0500] [localhost/sid#10080b708][rid#10096e898/subreq] (3) [perdir /Library/WebServer/Documents> add path info postfix: /Library/WebServer/Documents/games.template.php -> /Library/WebServer/Documents/games.template.php/
::1 - - [29/Jul/2008:18:35:20 --0500] [localhost/sid#10080b708][rid#10096e898/subreq] (3) [perdir /Library/WebServer/Documents> strip per-dir prefix: /Library/WebServer/Documents/games.template.php/ -> games.template.php/
::1 - - [29/Jul/2008:18:35:20 --0500] [localhost/sid#10080b708][rid#10096e898/subreq] (3) [perdir /Library/WebServer/Documents> applying pattern '^/games(/)?$' to uri 'games.template.php/'
::1 - - [29/Jul/2008:18:35:20 --0500] [localhost/sid#10080b708][rid#10096e898/subreq] (1) [perdir /Library/WebServer/Documents> pass through /Library/WebServer/Documents/games.template.php
::1 - - [29/Jul/2008:18:35:20 --0500] [localhost/sid#10080b708][rid#100970898/initial] (3) [perdir /Library/WebServer/Documents> add path info postfix: /Library/WebServer/Documents/games.php -> /Library/WebServer/Documents/games.php/
::1 - - [29/Jul/2008:18:35:20 --0500] [localhost/sid#10080b708][rid#100970898/initial] (3) [perdir /Library/WebServer/Documents> strip per-dir prefix: /Library/WebServer/Documents/games.php/ -> games.php/
::1 - - [29/Jul/2008:18:35:20 --0500] [localhost/sid#10080b708][rid#100970898/initial] (3) [perdir /Library/WebServer/Documents> applying pattern '^/games(/)?$' to uri 'games.php/'
::1 - - [29/Jul/2008:18:35:20 --0500] [localhost/sid#10080b708][rid#100970898/initial] (1) [perdir /Library/WebServer/Documents> pass through /Library/WebServer/Documents/games.php
::1 - - [29/Jul/2008:18:35:20 --0500] [localhost/sid#10080b708][rid#10096c898/subreq] (3) [perdir /Library/WebServer/Documents> strip per-dir prefix: /Library/WebServer/Documents/ ->
::1 - - [29/Jul/2008:18:35:20 --0500] [localhost/sid#10080b708][rid#10096c898/subreq] (3) [perdir /Library/WebServer/Documents> applying pattern '^/games(/)?$' to uri ''
::1 - - [29/Jul/2008:18:35:20 --0500] [localhost/sid#10080b708][rid#10096c898/subreq] (1) [perdir /Library/WebServer/Documents> pass through /Library/WebServer/Documents/
::1 - - [29/Jul/2008:18:35:20 --0500] [localhost/sid#10080b708][rid#10097e898/subreq] (3) [perdir /Library/WebServer/Documents> strip per-dir prefix: /Library/WebServer/Documents/index.html -> index.html
::1 - - [29/Jul/2008:18:35:20 --0500] [localhost/sid#10080b708][rid#10097e898/subreq] (3) [perdir /Library/WebServer/Documents> applying pattern '^/games(/)?$' to uri 'index.html'
::1 - - [29/Jul/2008:18:35:20 --0500] [localhost/sid#10080b708][rid#10097e898/subreq] (1) [perdir /Library/WebServer/Documents> pass through /Library/WebServer/Documents/index.html
::1 - - [29/Jul/2008:18:35:20 --0500] [localhost/sid#10080b708][rid#100982898/subreq] (3) [perdir /Library/WebServer/Documents> strip per-dir prefix: /Library/WebServer/Documents/index.html -> index.html
::1 - - [29/Jul/2008:18:35:20 --0500] [localhost/sid#10080b708][rid#100982898/subreq] (3) [perdir /Library/WebServer/Documents> applying pattern '^/games(/)?$' to uri 'index.html'
::1 - - [29/Jul/2008:18:35:20 --0500] [localhost/sid#10080b708][rid#100982898/subreq] (1) [perdir /Library/WebServer/Documents> pass through /Library/WebServer/Documents/index.html
::1 - - [29/Jul/2008:18:35:20 --0500] [localhost/sid#10080b708][rid#10097e898/subreq] (3) [perdir /Library/WebServer/Documents> strip per-dir prefix: /Library/WebServer/Documents/index.php -> index.php
::1 - - [29/Jul/2008:18:35:20 --0500] [localhost/sid#10080b708][rid#10097e898/subreq] (3) [perdir /Library/WebServer/Documents> applying pattern '^/games(/)?$' to uri 'index.php'
::1 - - [29/Jul/2008:18:35:20 --0500] [localhost/sid#10080b708][rid#10097e898/subreq] (1) [perdir /Library/WebServer/Documents> pass through /Library/WebServer/Documents/index.php
::1 - - [29/Jul/2008:18:35:20 --0500] [localhost/sid#10080b708][rid#100975898/initial] (3) [perdir /Library/WebServer/Documents> strip per-dir prefix: /Library/WebServer/Documents/favicon.ico -> favicon.ico
::1 - - [29/Jul/2008:18:35:20 --0500] [localhost/sid#10080b708][rid#100975898/initial] (3) [perdir /Library/WebServer/Documents> applying pattern '^/games(/)?$' to uri 'favicon.ico'
::1 - - [29/Jul/2008:18:35:20 --0500] [localhost/sid#10080b708][rid#100975898/initial] (1) [perdir /Library/WebServer/Documents> pass through /Library/WebServer/Documents/favicon.ico


Without backslashes.

RewriteEngine on
#RewriteRule ^games(/)?$ games.html [L]
RewriteRule ^/games(/)?$ index.php?action=games [L]
#RewriteRule ^events(/)?$ index.php?action=events [L]
#RewriteRule ^downloads(/)?$ index.php?action=downloads [L]
#RewriteRule ^support(/)?$ index.php?action=support [L]
#RewriteRule ^blogs(/)?$ wordpress/ [L]

How to get .htaccess URL rewriting working with the preinstalled apache2?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.