What is an index file?, My page previews well but wont display once copied to FTP:// |
What is an index file?, My page previews well but wont display once copied to FTP:// |
OutofmyDepth |
Mar 5 2011, 01:59 AM
Post
#1
|
Group: Members Posts: 2 Joined: 4-March 11 Member No.: 14,041 |
I have previewed my page in HTML compiler and all loks good.
When I upload to ftp:// the page does not display. Instead what is seen is a heading "Index of" and all the folders. Where have I gone wrong? Do I need and index file? |
Frederiek |
Mar 5 2011, 05:11 AM
Post
#2
|
Programming Fanatic Group: Members Posts: 5,146 Joined: 23-August 06 From: Europe Member No.: 9 |
What do you mean by HTML compiler? AFAICS, you can use it to compile web pages to create e-books.
Yes, there should be an index.html (or index.htm if you prefer), as that's what the server usually searches for when accessing your domain. Without such a file, the server will list the content of your domain's root folder as you experienced. |
OutofmyDepth |
Mar 5 2011, 08:43 AM
Post
#3
|
Group: Members Posts: 2 Joined: 4-March 11 Member No.: 14,041 |
What do you mean by HTML compiler? AFAICS, you can use it to compile web pages to create e-books. Yes, there should be an index.html (or index.htm if you prefer), as that's what the server usually searches for when accessing your domain. Without such a file, the server will list the content of your domain's root folder as you experienced. Thanks for your reply. I have tried using an Index.htm but may be missing the point. What does it need to contain? I have also tried editing my ISP's Index.php file. That is not going well. The host server, I believe, is a linux server running appache. Is this relevant? I used HTML-Kit to create and preview my files. Was pleased with how they looked. I seem to be misunderstanding something about how the files work together off the server and how htye work together on the server. I understand that HTML is client side and PHP is server side. Neither option is working for me right now. "the server will list the content of your domain's root folder as you experienced."Just so, and most frustrating is that when I click on the files displayed they work as expected, individually and together. Just cant get them to do that automaitically. |
pandy |
Mar 5 2011, 08:51 AM
Post
#4
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,730 Joined: 9-August 06 Member No.: 6 |
It doesn't need to contain anything special. The trick is in the file name itself. If you want the document you created to be the file that is served when people go to your domain or account without entering a specific file (e.g. http://example.com , http://users.example.com/OutofmyDepth/) just rename it index.html and place it in the web root (the main folder).
You don't need to know this, but if you want an explanation it goes like this.When someone requests a directory, the server automatically looks for certain files to serve up. It actually has a list that could look something like this. index.html, index.htm, index.shtml, index.php If the first file on the list exists it will be served up. If not, the server looks for the second file and so on. If none of the files on the list exists the server typically shows a listing of the files in the directory or gives a "forbidden" response of directory listing isn't allowed. When you go to http://htmlhelp.com you will be served http://htmlhelp.com/index.html , but as you notice the URL in the addressbar doesn't change. You can use this if you don't want the server to list the files in for instance your image folder. Just upload a blank index.html to that directory (well, it doesn't need to be blank). There are better ways, but if you can't access them, this you can always do. |
Christian J |
Mar 5 2011, 11:44 AM
Post
#5
|
. Group: WDG Moderators Posts: 9,656 Joined: 10-August 06 Member No.: 7 |
|
Lo-Fi Version | Time is now: 25th April 2024 - 08:20 PM |