Search code examples
.htaccessmime

Show images in IMG element without specifying extensions


I just moved between servers and now I cannot show images in IMG unless I specify the extension in the IMG SRC.

If I have a file called photo.png in root <img src="/photo"> used to open it. Now it doesn't and I get this error: "Failed to load resource: the server responded with a status of 404 (Not Found) ".

What steps do I have to follow in order to having my site recognize .jpg, .jpeg, .png and .gifs as images without adding the extension?


Solution

  • Options +MultiViews
    

    put this into the .htaccess file.