Davikore Posted July 24, 2016 Share Posted July 24, 2016 Hi,I want to use a the same photo for several image references.So in my different html pages: <img itemprop="image" title="$page_image_title1" alt="$page_image_alt1" src="http://example.com/ims/myhouse_green_timber_house.jpg"> <img itemprop="image" title="$page_image_title1" alt="$page_image_alt2" src="http://example.com/ims/myhouse_yellow_wooden_house.jpg"> <img itemprop="image" title="$page_image_title3" alt="$page_image_alt3" src="http://example.com/ims/myhouse_green_and yellow_cedar_house.jpg"> I want all three of these to point to my image : "http://example.com/images/myhouse.jpg"What is the best way to do this ?Should I use the .htacess to rewrite the url - would that workor is there a better way ? Many thanks for any ideas ... Quote Link to comment https://forums.phpfreaks.com/topic/301573-how-do-i-use-same-image-for-multiple-places/ Share on other sites More sharing options...
Jacques1 Posted July 24, 2016 Share Posted July 24, 2016 And why do you want that? Search engine trickery? What you describe is obviously terrible for performance and bandwidth, because the client has to download the exact same image over and over again (unless you literally redirected all image URLs to myhouse.jpg, which would be very confusing). If you map arbitary paths to arbitary paths, that also means you'll have to manually maintain a long list of all mappings. A better approach would be to clearly separate the physical path from the descriptive stuff: /images/actual_file_path--this-is-some-comment // cut off everything after "--" with a rewrite rules /images/actual_file_path?this-is-some-comment // no rewriting required; the query part is simply discarded Quote Link to comment https://forums.phpfreaks.com/topic/301573-how-do-i-use-same-image-for-multiple-places/#findComment-1534939 Share on other sites More sharing options...
NotionCommotion Posted July 24, 2016 Share Posted July 24, 2016 ??? <img itemprop="image" title="$page_image_title1" alt="$page_image_alt1" src="http://example.com/images/myhouse.jpg"> <img itemprop="image" title="$page_image_title1" alt="$page_image_alt2" src="http://example.com/images/myhouse.jpg"> <img itemprop="image" title="$page_image_title3" alt="$page_image_alt3" src="http://example.com/images/myhouse.jpg"> Quote Link to comment https://forums.phpfreaks.com/topic/301573-how-do-i-use-same-image-for-multiple-places/#findComment-1534951 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.