Not finding index pages? - html

Ok.. total noob question.
I always thought that when I saw a URL like www.siteName.com/designs/ .. that PHP or some CMS was at work. I know how filepaths work, etc. , but I always thought that generally simple sites were in a "flat" system
index.html
about.html
gallery.html
/css/
/js/
/images/
So today I just had one of those aha moments. And I now have my main directory with index.html, but a few folders (students/ , shows/, etc) In each of these I have an index.html page. This should essentially be the same as having students.html, shows.html in my main directory, correct? Except it would give me the kind of URL format I would like to have, yes? (eg mysite.com/students)
Problem is, my browser just shows me the directory. I see a file list with my index.html there, but the page is not loading automatically.
What stupid thing am I doing wrong? (I'm on localhost if that makes a difference). I thought that if your browser enters a directory it should load index.html (isnt that why people put blank index pages in a directory? To stop the contents from being listed?)

You have to configure your web server to do this. If you're running apache, it's done with a line in .htaccess like this:
DirectoryIndex index.php index.html home.html something-else.php
Those filenames are listed in order of priority, so if you have both index.php and home.html in the same folder, index.php is loaded. Usually this is set up by default, but servers can be configured a lot of ways.

If you use XAMPP on localhost, it will display the list of files instead of the index files. You can change it though, look at :
http://www.astahost.com/info/tiflds-setting-default-xampp-web-server.html
If you use something else then XAMPP there probably will be an settings somewhere to set the default file to load as well. Just Google it :)

Related

Why do people name their files index.html?

I have seen a lot of people been using that file name for their HTML files. I wonder why? I'm kind of new to HTML, I haven't learned much, but when I name my HTML files, I name them whatever I want. When I have been searching up examples of HTML, I have found they name it index.html. Why?
I have seen a lot of people been using that file name for their HTML files
You would typically use that name for one of your page, and it would usually be the home page.
When you arrive a website, for example www.website.com, you're not pointing to a file (like you would be if you typed www.website.com/about.html), you're pointing to a directory listing of all the files.
The webserver will try to serve a file, typically called index.html or index.php by default, but it could be something different, and it's configurable by editing your webserver's config files.
If the server doesn't find any file to serve (because you didn't include an index.html file or because you renamed it without editing the server's config) you will see a listing of the files, which is rarely the desired behavior, especially at the root of a website.
Generally the contents of index.html will be returned when just the directory is requested.
e.g. http://example.com/index.html is returned for a request for http://example.com
This is merely convention and is usually configurable.
Here is my take: It was likely named 'index' in the original internet because it is the 'indexing page' that directs to the sub pages, and you would go back to the index page to go to another page. This was before images and search engines. Later it got more advanced with a menu on all pages. This is how I remember it, but it's a long time ago.
https://twitter.com/PresidentUSW1/status/1442236777293496325?s=20
The default landing page of many Web servers defaults to index.html or default.htm and either way it's simply a start page. It's not necessary at all.

Have Domain Open HTML File?

I am currently making a website, and have a folder containing CSS3 and HTML5 code in it. When I click on the index.html file, it opens up a local file and I can see my design and text in it. However, I am not sure how to have my website "point" to the index.html file, so it shows the content that is in the file. (I bought the domain with GoDaddy).
Thanks for the help!
Make Sure the directory does not have any other default files like default.php,default,html,etc and also there should be only one index file. if there is any index.php it will overtake index.html. Please make your question more clear and tell use which hosting are you using.....
Check documentation of the company that provides you hosting - the server has a list of files it looks for on disk in a given order. Only thing you need to do is to rename you file to match server's "lookup table".
Relevant part of configuration of the most popular web servers:
apache: https://httpd.apache.org/docs/current/mod/mod_dir.html
nginx: http://nginx.org/en/docs/http/ngx_http_index_module.html

Is it OK to have more than 1 index.html on your website?

I have a index.html on my root folder of a subdomain
i.e. example.example.com/index.html
and then I made a second folder (which is located in the root folder)
example.example.com/folder/index.html
Is this good/recommended?
PS I'm pretty new to this so I have a follow up question. Does this have tie in to sitemaps in a big way and do people usually use an app to do the their "sitemapping" for them?
That's fine, but there should only be 1 per folder. The index.html is the file your webserver will serve up if another is not specified, so it is normal to have one in each directory.
As far as creating the sitemap, there are a lot of tools online that will create an XML sitemap for you and that is what people usually use.
Its ok to have multiple index.html files, may be some experts will say its not a recommended way. But in my point of view as long as you know that what's going on you can have tons of index.html .

Link not going back to home page

I have researched this to death including on this page. My index page is outside my html folder and when I hit the nav link it will not take me back home(index page). I have seen a few post on here regarding this situation, see below:
There are also two special directory names: . and ..:
. means "current directory"
.. means "parent directory"
but I have tried several see below for examples that I have tried. The index page is on/in the root directory (folder), all the other nav links work as they are in the html folder and they are up one level.
I have tried:
Index
Index
Index
Index
Out of desperation I have tried several things I knew would not work, I would really appreciate your assistance in this matter.
littleone
In my opinion the safest way is using
index
This will move the user to the root directory no matter in which directory the user currently is.
It's quite short which can be helpful too. In most cases you can omit index.html because the server uses this file automatically if you visit a directory.
I'm no web server specialist, but I'm sure you're saving your index.html in the incorrect location.
Your /html folder is your ROOT folder, anything outside of it isn't accessible via a URL. I'm sure there are ways to override that, but I have never seen anyone do this even in the most complex projects I've worked in.
For example, your site www.yoursite.com is located in the /html of your server. So if you have your index.html file outside of that folder, that file can't be accessed or served at all.
The common sense solution is to move your index.html file to the /html folder. When you do this you can then use a slash in your href, like so:
Index

Web site title showing index of

Google search jobbulls website title showing index/
I have uploaded all of my files for my website. When I type in my domain name, I see a page titled "Index of /" that lists each of the files used to create my website. Can anyone tell me how to fix this?
Your first page should be called index.html
In fact, it can be called a lot of names, this is the priority that will decide the one to display: (higher first)
index.html
index.shtml
index.php
index.htm
default.html
Default.htm
default.html
Default.html
default.shtml
Default.shtml
page1.html
index.pl
index.cgi
index.php3
index.phtml
home.htm
home.html
home.shtml
index.wml
based on the DirectoryIndex by Apache.
Now as a second answer, if you uploaded the files and these contain a file listed above and it still doesn't work, then make sure you uploaded the files in the correct directory. Sometimes ftp brings you one level higher than what is called the 'webroot' check to see if there is no 'public_html' or 'www' or 'html_docs'.
In that case, make sure your files are uploaded in this folders.
It maybe the uploading folder problem.
First of all you can try these 3 methods,
Option 1 – Upload Your Website via xxxx's File Manager
Option 2 – Uploading Your Website via FTP such as FileZilla
Option 3 – Uploading Your Website via cPanel’s File Manager
Select the option and start to upload.
Open the server folder and you may can see some folders like .htaccess, public_html.. Please open the folder public_html and upload into it.
If you still see the problem, reupload the files again.
Thank you.
You need an index or a page for the web server to serve up as the page for the site.
To get started you could upload an "index.html" page and most web servers will serve this as their first page by default.
Upload this line to your .htaccess file and see what happens
DirectoryIndex index.html index.php
If that doesn't work, can you post the contents of your .htaccess file?
This should work for a site coded with php.
Best solution for this you have to set Options -Indexes in .htacess file.
I had the same problem. This was because I used an capital 'I' as first i of index.html. This did not work because 'Index.html' was not in my directory listings. The standard solution for this would be changing Index.html to index.html. (note the capital 'I' and the lowwer case 'i')
ok first of you have to upload zip file while so It will not give to error while uploading.
put your folder in public_html section extract it.
main page of your file which have to call by default by entering your site name
is index.html don't give name Index.html system has access for index.html