Apache expands REQUEST_FILENAME with filetype

Posted by Lauer on Server Fault See other posts from Server Fault or by Lauer
Published on 2010-05-17T15:05:27Z Indexed on 2010/05/17 15:11 UTC
Read the original article Hit count: 227

I have a .htaccess fil on a Apache22 server.

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ /index.php?p=$1 [L]

The idea is when the request is /testpage it should be rewritten to /index.php?p=testpage. The problem is that apache does a write before my file, so the actually request is testpage.xml which actually does exists. Therefore, the first RewriteCond is newer true, and my rewrite rule is never applied on the /testpage request.

There server should be a standard setup on a FreeBSD server. I know this work on other servers.

© Server Fault or respective owner

Related posts about apache

Related posts about mod-rewrite