Could not Load any images files ( jpg, jpeg, gif, png, bmp etc.) where as .php files are running properly in XAMPP project.

Or

While browsing any image folder within the project folder i.e. “xampp/htdocs/<project-folder>” XAMPP  could not list image files.

image_files_not_listed1

Solution :

Generally people faced this issue when they tried to restore the whole online site to their local system, So that they always have the backup copy of whole site.

The reason behind not displaying the images files is due to “.htaccess” file within the directory. The setting inside the “.htaccess” file prohibits the display of image files.

There are two methods to resolve the issue:-

  1. Remove/Delete the “.htaccess” file from the directory.
  2. Comment or remove the following line in .htaccess file –

RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ – [F,NC]

Commenting the statement .htaccess file can be done by writing # symbol in front of the statement. E.g.

# RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ – [F,NC]

After following one of the above method the image folder will look like –

All the images files are listed after doing necessary changes
All the images files are listed after doing necessary changes



Comments are closed.