Use htaccess / php to hide the true url of the image

I am running several websites that show the same pictures. I would like to host them on the "source" website and name them on each of the target sites.

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

I tried using the htaccess / PHP overwrite feature but no luck. The "original" site will be on one server.

For example. I am posting xxx.jpg on "source_site.com/image_source/" and on the target site, each image with an href like "target_site / common_images / xxx.jpg will actually show the site_source image, but with a local href.

Also, one more question. If I manage to do what I want, will the "latent" image be cached by cloud flare like a normal image?

Many thanks for your help!

+3


source to share


1 answer


Add this code to your .htaccess file

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

      



for more link hide image path using htaccess?

+1


source







All Articles