httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brad Plant <>
Subject [users@httpd] Using mod_rewrite and mod_cache together
Date Sat, 02 Aug 2008 01:17:17 GMT
Hi list,

I am wanting to use mod_disk_cache to cache dynamic content. Basically, I have a .htaccess
file that looks something like this:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*) index.php?url=$1&%{QUERY_STRING} [L]

Which says, if the file requested does not exist, rewrite the request to the index.php file
and pass the requested url to the url variable in the GET string. The end result is that a
request to /privacy gets rewritten to index.php?url=privacy which then looks up the page in
a database etc.

Turning on mod_disk_cache and setting the server log level to debug, I get the following in
error_log when do a wget on /privacy:

[Sat Aug 02 11:04:09 2008] [debug] mod_rewrite.c(1789): [client] mod_rewrite's
internal redirect status: 0/10.

But if I access index.php?url=privacy using wget, I get this in the error_log:

[Sat Aug 02 11:07:31 2008] [debug] mod_cache.c(556): cache: Caching url: /index.php?url=privacy
[Sat Aug 02 11:07:31 2008] [debug] mod_cache.c(598): cache: Added date header
[Sat Aug 02 11:07:31 2008] [debug] mod_disk_cache.c(642): disk_cache: Stored headers for URL
[Sat Aug 02 11:07:31 2008] [debug] mod_disk_cache.c(744): disk_cache: Body for URL

Is there a trick to getting mod_cache to cache pages when mod_rewrite is used or is this not

I am using apache 2.0.55, but I have tried it on apache 2.2.9 as well without success.

Thanks in advance.



The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message