Marc
Marc

Reputation: 31

Use Htaccess / php to hide image true URL

I run several websites who show the same pictures. I'd like to host them on a "source" website and call them into each one of the "target" sites.

But I don't want to show an external URL in the image HREF. I'd like to rebuild them with htaccess or php.

I tried using htaccess rewriting/PHP header function but with no luck. The "source" site would be on the same server.

For instance. I host xxx.jpg on "source_site.com/image_source/" and on the target site, every image with href like "target_site/common_images/xxx.jpg would be actually show the site_source image, but with a local href. Is it possible ?

Also, just another question. If I succeed in doing what I want, would the "cloaked" image be cached by cloudflare as a regular image ?

Thanks a lot for your help !

Upvotes: 3

Views: 1313

Answers (1)

Ananta Prasad
Ananta Prasad

Reputation: 3859

Add this code to your .htaccess file

RewriteEngine on
RewriteRule ^Info/img/([^/]+)$ Admin/img/$1 [L]

for more refer hide image path possible with htaccess?

Upvotes: 1

Related Questions