I want to change the image path (even stylesheet background image url) with .htaccess, My Magento site gets all images from production site in local server,

  • Why dont you use core functionality System > Configuration > General / Web > Unsecure / Secure > Base Media URL? Commented Feb 17, 2017 at 9:02

1 Answer 1


Hello I have website1 is http://example1 and another is http://example2 If you want to change path using .htaccess the rule be

Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /

#RewriteCond %{HTTP_HOST} ^(www\.)?example2\.com$ [NC]
RewriteRule ^media/img/ http://www.example1.com%{REQUEST_URI} [L,R=301,NC]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.