Why is there an index.html file in almost every folder in Joomla? What folders do not contain an index.html file and why?
The blank index.html file in each folder is to prevent directory browsing via web address.
On a poorly configured web server someone could see all the files contained in a folder by simply browsing to the path, such as www.yoursite.com/images/, this could be a potential security problem on servers without directory browsing (indexing) turned off.
Having the blank index.html file returns a blank white screen to the browser rather than displaying the contents of the folder.
The index.html file isn't necessary, it's in the folders as a layer of security. It is there to keep prying eyes from being able to see a directory structure, if there was no index.html file and someone randomly went to http://yoursite.com/scripts/js/ (for example), they could potentially see a listing of all files in that directory. Instead, with the index.html file in place they see a blank landing page:
<html><body bgcolor=" #FFFFFF" ></body></html>
Another approach (for apache servers) is to add this line to the .htaccess file placed at the root directorty of the website:
Options -Indexes
It prevents directory browsing for the whole website.
Related
So My issue is as follows. My users can upload files and profile images into the app, Right clicking a profile image and opening in a new tab shows the image (which I want)
https:/my-app.com/storage/profile-photos/sad65f87as5f.png
If I remove the filename part of the url then I get forbidden which I also want
https:/my-app.com/storage/profile-photos
If I then however remove profile-photos from the url it lists all the folders in my storage directory. How do i make this forbidden?
https:/my-app.com/storage
In addition I have an uploads folder in the storage directory and this and all its contents are publicly available.
I'm using apache php8.1 and laravel9 in this project. It is also a production environment.
*** Solution ***
As alluded to in the comments below by DadoH, i needed to add code to stop indexing to the .htaccess file.
Adding to storage folder didn't work but adding the Options -Indexes line to the top of the .htaccess in the public folder did.
You can disable browsing of a folder when there is no index, if you add Options -Indexes into your .htaccess in your storage folder.
I have recently finished building my website and since I didn't know how to put it online I decided to follow this tutorial: https://youtu.be/tq7dqdHCc7U
Everything worked fine until I tried to upload my .html files. I copied them into a www folder I created, but when I try to access the site with myIP/~username, I get a 404 error page. What am I doing wrong?
I guess you have put html file in wrong directory. Please put a sample index.html in root directory and in public_html folder. and try to access with domain name. it should work
A 404 error means that a valid page wasn't found. The only html file that apache know to render automatically is an index.html file. That's the default for the root url (in your case: yourIP/~username). So to fix the problem, you can either change what apache looks for in a index page in your httpd.conf, rename one of your files to index.html, or just append the name of a file that does exist to the end of your URL: yourIP/~username/myPage.html
google is not crawling some of my site urls
for that i want to made some changes in the robots,txt file
. but when i go to the magento root folder and i try to edit the
robot.txt file
, and when i reload that file on the browser it is not showing the changes i made in the files.
the file permission is set to 777 and the cache is clear
I even rename the file but it still loads on browser.
Please suggest me what can be the issue.
thanks in advance.
I noticed Joomla, Wordpress and other CMSs have blank index.html files in ALL their sub folders to prevent people from peeking into the folder structure. My question is why can't they forbid folder viewing using the .htaccess file instead of putting a blank index.html file into all the folders. What's the difference and why have they chosen index.html?
Turning off folder 'Indexes' is best done in the master httpd.conf or vhosts.conf file rather than local .htaccess files.
Joomla (and Mambo before it) have been around quite a while and are used widely on shared hosting servers. The decision was taken to use index.html files as a safe fallback given the 'mixed' nature of shared hosting. Obviously .htaccess files are apache only, can cause server 500 errors if present on servers not expecting them or if they contain directives not supported by certain server setups. Consequently by default Joomla doesn't ship with a .htaccess file as such. There is a htaccess.txt file which the user needs to put in place manually if they activate certain features. It is assumed that a user knowledgeable enough to put the file in place will understand the consequences and if it does kill their site they will immediately understand the cause - due to the error immediately following their actions.
As server setups have advanced there is (sometimes heated) discussion about the current validity of the use of index.html files - but for now the policy is that all add-ons should ship with 'blank' index.html files in all folders.
I want to have a sitemap structure where the sitempasindex file is located in the root path (example.com/sitemaps.xml) and it references several sitemap[n].xml files located in a folder (example.com/static/sitemap1.xml). Those sitemap[n].xml files link to webpages that are in the rooth path (like example.com/helloworld.html).
Is that posible? I'm asking because I know that if the sitemap.xml file is placed within a folder, it can only contain webpages that are under that folder.
Thanks!
I believe you easily have
example.com/sitemap-index.xml
point to e.g.
example.com/sub1/sitemap.xml
and
example.com/sub2/sitemap.xml
however each sitemap.xml should only contains URLs within each their subfolder. (From your question, it seems you have those sitemap.xml files link to paths in root. I doubt that works, but you could try run a small test and submit to Google. If no errors then...)
The location of a Sitemap file determines the set of URLs that can be included in that Sitemap. A Sitemap file located at http://example.com/catalog/sitemap.xml can include any URLs starting with http://example.com/catalog/ but can not include URLs starting with http://example.com/images/.
From google perspective, they should be available on main root of the website. http://example.com/sitemap.xml, When you submit it through the subdir in webmaster tool "http://example.com/catalog/sitemap.xml" google won't crawl it and always showing us pending index status.