HTML image src case sensitivity

I have folder names in folders. But it srcis in lower case, so this is not loading images.

I cannot make all image folders lowercase, so I want to change my code to accept a case-insensitive path.

I have a link like this:

<a href="http://www.google.com">
  <img id="productMainImage" src="images/Tulips.jpg" alt="image" escapeXml="false" class="product_main_image"/>
</a>

I want to make the src image case insensitive; I want the code, even if src ="IMAGES/Tulips.jpg".

How to solve this problem?

+4
source share
3 answers

Either you can use JS for this, using toLowerCase(), or you need to rename them yourself.

, , HTML , UNIX- , Microsoft .

, - , PHP, strtolower(), , JavaScript, .

+3

, .htaccess RewriteRule . - :

RewriteRule ^IMAGES/(.*)\.(jpg|jpeg|gif|png)$ images/$1.$2
0

, - - , OSX , Linux.

, - apache mod_rewrite - , . , , , .

0

Source: https://habr.com/ru/post/1526321/


All Articles