Forum Moderators: phranque
I've got the following working in httpd.conf
RewriteEngine On
RewriteRule ^/download/(.*)$ /download/getFile.php?id=$1
I'm trying to do the same thing in an .htaccess file. I've put it in
the /download/ directory:
RewriteEngine On
RewriteRule ^(.*)$ /download/getFile.php?id=$1 [L]
I've searched through forums, but I feel like I am missing a simple detail.
RewriteEngine On
RewriteCond $1 !^getFile\.php$
RewriteRule (.*) /download/getFile.php?id=$1 [L]
Also in .htaccess, you must explicitly prevent recursion by disabling the rule if the URL is already getFile.php.
Jim
[edited by: jdMorgan at 12:21 am (utc) on April 26, 2007]
AllowOverride None
in my sites <Directory "/Users/matt/Sites"> section.
I had been through my httpd.conf before, and messed with that setting, but I had only made changes to:
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
For some reason I dismissed it, thinking that if could could make Rewriterules work in the httpd.conf, I should be able to put them in an .htaccess file. I accidentally and specifically ignored the setting disabling the .htaccess access.