Apache - rewrite images to php file with .htaccess

后端 未结 3 2082
慢半拍i
慢半拍i 2020-12-10 21:14

I\'m looking for a way to rewrite all my image requests from one folder into some.php file, while preserving the original image url (or par

3条回答
  •  长情又很酷
    2020-12-10 21:39

    It sounds like you you want the filename of the image in the url to be included in the new php url, not the entire url. So something like:

    RewriteRule ^folder/img/(.*[.]jpg)$ /folder/some.php?filename=$1
    

提交回复
热议问题