Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mod_rewrite rules logging "Config variable ${REQUEST_URI} is not defined" on every request

I have the following .htaccess on an Apache/2.4.2-win32 server:

# Turn mod_rewrite on
RewriteEngine On

# Allow direct loading of files in the static directory
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^/?static/(.+)$ - [L]

# Send all other requests to controller
RewriteCond ${REQUEST_URI} !^/?(spf/index\.php)?$
RewriteRule .* spf/index.php [L,QSA]

This works well and does exactly what I want it to. For those of you who can't be bothered working out what it does, it sends all requests through spf/index.php unless they are for a file that exists in the static directory.

The file resides in the virtual host's documentroot.

Every request that falls through this .htaccess generates the following error:

[Wed Aug 01 14:14:16.549835 2012] [core:warn] [pid 7100:tid 1076] AH00111: Config variable ${REQUEST_URI} is not defined

This is not actually causing a problem - every request works as expected - but it's filling up my error log and I don't like it.

According to Google, no-one has ever had this error before. That's as far as I've got with debugging it, I don't really know where to go next.

Anyone got any idea what's going on here?

P.S. I'm aware this might be a question better suited to SF, if the general opinion is that it doesn't belong here I'll move it.

like image 679
DaveRandom Avatar asked Aug 01 '12 13:08

DaveRandom


1 Answers

You need to replace the $ with a %:

RewriteCond ${REQUEST_URI} !^/?(spf/index\.php)?$

to

RewriteCond %{REQUEST_URI} !^/?(spf/index\.php)?$
like image 172
Jon Lin Avatar answered Oct 22 '22 08:10

Jon Lin