Elxis CMS Forum

Support => General => Topic started by: kyomar on October 08, 2019, 11:33:39

Title: Index.html file in media and it's subfolders?
Post by: kyomar on October 08, 2019, 11:33:39
Hi all, perhaps a stupid question. I just stumbled over this and I am curious what the index.html file is doing in the media folders. If somebody would be please so kind to lighten me up. Thank you!
Title: Re: Index.html file in media and it's subfolders?
Post by: michalis1984 on October 08, 2019, 11:56:35
Empty index.html to prevent direct browsing of the media folder.
Title: Re: Index.html file in media and it's subfolders?
Post by: kyomar on October 09, 2019, 11:52:39
Thanks a lot for the prompt response michalis1984. I am always learning. Over time I have added a few media/image folders but didn't add the mentioned index.html file. I have done this now. Curious, isn't there an easier more bullet proof way to do that (e.g. htaccess)?
Title: Re: Index.html file in media and it's subfolders?
Post by: datahell on October 09, 2019, 19:14:25
In most servers directory browsing is disabled, so there is no problem. If there is no index file and directory browsing has been left to enabled then someone would be able to see all of your files in a folder. Although these files are not secret you dont want this way of browsing to your site. Elxis has some empty index.html files for this reason, not in all folders but on many of them. With htaccess you can completely prevent access to a folder but this is not what we want. I am sure that there will be a complex htaccess rewrite rule that will do the trick but there is an other factor too: htaccess is not available in all sites. So, an index.html file is the simplest and best solution.