Hi, in order to be able to see a webpage instead of directory listing, you need to have a file named either index.php or index.html in those folders.
Could be because those files went missing during upload process?
I have tested the code on other hosting platforms and everything is working fine there, There is no file missing it or any broken code that could affect the issue. all html files are in the root directory and .CSS and ,js are in one folder, as you can see in screenshot
If you don’t want people to show the Directory Listing on where you have files other than your website’s index files stored, you can either create an empty index.html or index.htm file or you can put this in a .htaccess you have to create on every folder:
# Disable directory listing
Options -Indexes
If you want to get fancy, you can also redirect people to your HTML pages for fantasy and vector with PHP by creating an index.php file instead of an empty HTML one on the folders with this content:
<?php
// this is for the fantasy folder; replace it with vector.html when you create it on the vector folder
header("Location: /fantasy.html");
exit;
?>
I will try PHP, I’m not good at PHP, so I have to see how to do it.
I have created index.php in both folders “fantasy” and “vector” with content contant
In “fantasy” folder
<?php
// this is for the fantasy folder; replace it with vector.html when you create it on the vector folder
header("Location: /fantasy.html");
exit;
?>
“vector”
<?php
// this is for the fantasy folder; replace it with vector.html when you create it on the vector folder
header("Location: /vector.html");
exit;
?>
OK, I can see the problem now. You’re trying to make vector.html and fantasy.html accessible without extension, but the redirects collapse causing an error “Too many redirects”. Try to add this to the main .htaccess file of your website and remove the other lines that do the redirect to the non-HTML version:
Options +MultiViews
Like so your website will be accessible through both non-HTML and HTML extension at the end. Then you can remove the index.php on the folders as that isn’t needed and remove the / before a folder’s name to see the HTML page content.
Can you please tell me what exactly should I remove?
I have already removed: “Option MultiViews” and using “Option +MultiViews”
If there is anything else that needs to remove then please give me the whole .htaccess code that needs to use. because after removing “Option +MultiViews” and “Option MultiViews”, the issue is still the same.
but why infinityfree has to do all these things, when I was using another web hosting with the same file director it was working there but not on Infinityfree!