I'm trying to do something like the following in my .htaccess file:
Alias /assets /location/of/files
RewriteCond %{REQUEST_URI} ^/assets/[0-9]+.jpg$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* /build_thumbnail.cfm?path=%{REQUEST_URI} [QSA,L]
So in theory it's quite straightforward:
- an image is requested from a url starting with /assets/
- apache checks for the existence of the file
- if found, the file is served
- if not, a script is run instead
This is working fine in other places but this is the first time I've tried to use it on a directory included as an Alias. As I understand it Mod Rewrite runs before Mod Alias which would surely cause this not to work (and in truth my Alias line is in the apache conf while the rest is in .htaccess).
Is there a way to get Mod Rewrite to acknowledge the Aliased directory?
Is it possible to change the Alias line to a Rewrite line instead?