: Redirect all images in a directory to another website using .htaccess How can I redirect all .png and .jpg image URLs within the /tool/img directory to another website? Filenames can consist
How can I redirect all .png and .jpg image URLs within the /tool/img directory to another website? Filenames can consist of special (unicode) characters.
For example, the following URL:
example.com/tool/img/filename-with-special-chars.png
Should redirect to:
newdomain.com/img/filename-with-special-chars.png
More posts by @Sent6035632
1 Comments
Sorted by latest first Latest Oldest Best
Try something like this:
RewriteCond %{REQUEST_URI} ^/tool/img/ [NC]
RewriteCond %{REQUEST_URI} .(jpg|png)$ [NC]
RewriteRule ^/tool/img/(.*)$ newdomain.com/img/ [NC,U,QSA]
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.