You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Reto Kaiser <re...@gmail.com> on 2009/02/06 20:05:25 UTC
[users@httpd] RewriteRule and matching URI with *before* rewriting
Hi,
I'm using the Zend PHP Framework with Apache 2. The ZF uses a
bootstrap file, so all requests are rewritten to index.php:
RewriteRule .* index.php
Now I'd like to serve CSS and JS resources dynamically with the
index.php. So a request to "/resource/css/test.css" should deliver a
CSS file (echo'ed by index.php). This works fine.
But since this is static information, I'd like to let the client cache it.
Before serving those files dynamically with php, I had another
subdomain, which had the following options in the apache-config:
ExpiresActive on
ExpiresDefault "access plus 1 day"
To add those options again to all requests to URIs under "/resource/"
I somehow have to match them. I tried it with the Location-Directive:
<Location /resource/>
But this does not work. I guess it's because the rewriting happens
before the matching. When I use "<Location index.php>" it works... But
that way I cannot separate the "/resource/"-requests from the rest.
I also tried to rearrange the config-block for the rewriting and the
matching of the "/resource"-requests. Nothing seems to work.
Does someone has an idea what could work?
Sincerely,
Reto
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org