RewriteCond and Alias
Posted
by Ralphz
on Stack Overflow
See other posts from Stack Overflow
or by Ralphz
Published on 2010-04-09T18:51:29Z
Indexed on
2010/04/09
18:53 UTC
Read the original article
Hit count: 451
apache2
|mod-rewrite
I have defined alias that looks like this:
Alias /pictures/sm/ /var/www/my_site/data/_active_thumbnails/
Later in the VirtualHost section have:
DocumentRoot /var/www/my_site/sites/www.my_site.com/htdocs
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^/thumbnails/(.*)\.(jpg|JPG) /images/stg-list-img.png [PT,L]
What I'm trying to do is to display /images/stg-list-img.png placeholder image only if the original image does not exist on the drive.
Right now it's replacing all the images from /thumbnails/. It looks like the RewriteCond is not aware about the Alias. Is there the way to overcome it?
Thanks
© Stack Overflow or respective owner