| | |||||||
| Technology & Technical Skills Computer skills, hardware, software, internet topics, gadgets, programming |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Family Member Join Date: Feb 2009
Posts: 2,044
|
What does that mean, CoolBee? What I mean is: if you have a directory on a server that is located say in www. my site .com / subarea / and you have a bunch of files in there something.pdf, something.txt or whatever. If it finds index.html it will load that. What other html file name could I put in there that will be loaded by browsers before it resorts to simply listing the directory contents? I want to call the html file something other than 'index.html' . I've tried things like home.html, or index1.html but no joy - it goes straight to listing the directory contents. Or am I just going to give in and have yet another index.html file? |
| | |
| | #4 (permalink) |
| Family Member Join Date: Nov 2006 Location: Somewhere in time...
Posts: 2,213
|
Depends totally on the server. Some require default and some require index. If you have full access to change the config file, you can name it anything you want. If it's through a hosting company, you probably don't have that kind of access.
|
| | |
| | #5 (permalink) |
| Family Member Join Date: Feb 2009
Posts: 2,044
|
Where do I find the config file (if I have the right access) and what do I put in it? I have put 'default.html' and when I browse using Firefox or IE8 it is coming up with that page. So assume that means the server is ok with that? |
| | |
| | #9 (permalink) | |
| Family Member Join Date: Nov 2006 Location: Berlin, Germany
Posts: 8,749
| Quote:
If you for example run a django server than filenames don't matter much because there are extra function that translate the queries that the server gets. | |
| | |
| | #10 (permalink) |
| Junior Member Join Date: Mar 2009
Posts: 3
|
As Brutha has said, it's down to the software you have installed. It also depends on whether your web server is running Linux or Windows. The most common web server that ISPs might install as standard, Apache / Linux, makes life even more complicated, in that it splits up its config files into different places. If that's the "master config" file is /etc/apache2/apache2.conf In that, there's a line that will read something like: ---- DirectoryIndex index.html index.cgi index.pl index.php index.xhtml (without the dashes) That means that, it will display a file called index.html... but if that's not there, index.cgi... but if that's not there either index.pl and so on. Fuller techy info, should you require is, is at mod_dir - Apache HTTP Server Alternatively, if you can tell us what server software you're running, we might be able to give you the answer that relates to your setup. Regards, Mark |
| | |
| | #13 (permalink) |
| Family Member Join Date: Feb 2009
Posts: 2,044
|
well, index.html usually has something to do with the site - eg it's the home page or whatever. I wanted a page that said nothing other than 'you have arrived here by mistake' so people don't get faced with a file listing. So I wanted a distinctly different name, rather than have several different 'index.html' on my site. The files in the directory are various things for people to download which are linked to from elsewhere. I don't particularly want people bumbling around the whole directory on the one hand, and on the other, I have found quite a lot of people get alarmed when they see a file listing because they don't know what to do. |
| | |
| | #14 (permalink) |
| Member Join Date: Jan 2009
Posts: 68
|
Normally, the filename of index.html (or whatever) is hidden if the browser has just requested the directory, and only appears in the URL if the browser actually requested index.html by name. Is your server doing something different?
|
| | |
| | #16 (permalink) |
| Family Member Join Date: Feb 2009
Posts: 2,044
|
Yes but I didn't want to get my index.html files confused with each other so I wanted a different name for the 'you're here in error' type file! Hm I don't want the display directory setting turned off because some of my folders deliberately have it there for things for those less confused by directory listings! @icewolf = it's not that it's showing a filename in the way I think you mean, eg it isn't that it is showing blogs/index.html (which it isn't), it was (until I put default.html in there) opening a browser tab simply listing all the files in the directory. |
| | |
| | #17 (permalink) |
| Senior Member Join Date: Nov 2006 Location: Ballarat, Victoria, Australia
Posts: 287
|
If it's an Apache server, you can use a ".htacces" file to specify the default page on a directory by directory basis. That way, you can call it what ever you want. As Chris said though, the best solution is to have the server NOT display a directories contents when there is no default file. A server wide setting would apply to any folder throughout the site. |
| | |
| | #19 (permalink) |
| Family Member Join Date: Feb 2007
Posts: 2,432
|
Are you saying if there are multiple index.html files in the same domain but in different folders that search engines might make that folder index first on google, rather than the actual (root) domain itself? I've never had this problem. With search engines I think they automatically index the root directory first regardless of sub folders with index.html files in them, maybe I am wrong? I'd be interested to know. Edit***I think I get what your saying. You could change the permissions settings so no one can see the contents of that folder. So basically it will block outsider users seeing content, the other thing if you just want to share pdf, image links with people, you could actually give them the complete address of the file and lock the folder contents from being seen. I usually just put a blank index.html file and send people the exact path so if I wanted to send them a pdf it would be www. my site .com / subarea / my.pdf or an index.html file with html links to the actual files that I want to share in that folder. Last edited by ellie; 04-10-2010 at 12:51 PM. |
| | |
| | #20 (permalink) |
| Family Member Join Date: Feb 2009
Posts: 2,044
|
No, I'm not saying the server will confuse it, I'm saying I might! In my way of working - index.html has something to contribute to the website eg as a home page or whatever. I wanted a DIFFERENT way of addressing the html page that would show up if users inadvertently (or deliberately!) tried looking in a sub-folder to see what was there! (Am I really the only person that does that? LOL!) The one I have now named 'default.html' is being copied into all the sub-folders that I create. People should only get stuff out of those sub-folders via a direct link. I just didn't want people noseying around seeing what else was there that might take their fancy or indeed having a nervous breakdown when confronted with a directory listing and being rendered paralysed because 'it looks complicated'. There is only 1 index.html on my site (well that's not quite true because sub-domains have their own but that is different). Last edited by CoolBee; 04-10-2010 at 01:16 PM. |
| | |
| | #21 (permalink) | |
| Family Member Join Date: Nov 2006 Location: Somewhere in time...
Posts: 2,213
| Quote:
Coolbee, If all you're doing is trying to keep people from "perusing" the directory, then I fail to see what the problem is with just using an index.html file (other than you being confused) but, since it can be blank, There's nothing to get confused with. It's the standard way of doing it & it doesn't even have to have code in it (the page can be totally empty). What is the site in question? | |
| | |
| | #22 (permalink) |
| Family Member Join Date: Feb 2009
Posts: 2,044
|
Just for my own desire I wanted to use something other than 'index.html'. I create sub-folders 'on the hoof' and it's useful for me to just be able to copy and paste a default.html file without worrying about the content, whereas if I pick an index.html file I might get the wrong one. I'll PM you the site LC because I don't want people to go looking for it unless I have deliberately sent them the link!!!! |
| | |
| | #23 (permalink) | |
| Family Member Join Date: Feb 2007
Posts: 2,432
| Quote:
It wil come up with something like "permission denied" and I even think you can customise that notice, not sure how though. | |
| | |
| | #25 (permalink) |
| Family Member Join Date: Nov 2006 Location: Somewhere in time...
Posts: 2,213
|
Since you are running an apache server you can try this: How To: Change Your Websites Index File a simple trick using the .htaccess file A simple tutorial which only involves editing one little file. Useful for those of us who have mime-typed extensions or who are creating lots of test design files and want an easy way to make the design they like best their default file.
Open a text file Put this code in the first line: See Below (change the bold text to what you want to call the file) ex. index.html - default.html - sunshine.html (doesn't matter) DirectoryIndex name_it_what_you_want.html Then save the text file as .htaccess and put it into the folder of your root directory |
| | |
| | #27 (permalink) | |
| Senior Member Join Date: Nov 2006 Location: Ballarat, Victoria, Australia
Posts: 287
| Quote:
Another tip: In order to actually create a .htaccess file, you have to use Notepad (if you're on Windows) and save the filename with inverted commas (eg. Save As: ".htaccess"). This is because Windows won't let you manually name a file with a . at the start. If you're on a Mac or Linux, it's a whole other process because files starting with a . are by default, hidden files. | |
| | |
| | #28 (permalink) | |
| Family Member Join Date: Nov 2006 Location: Somewhere in time...
Posts: 2,213
| Quote:
| |
| | |
| Bookmarks |
« Previous Thread
|
Next Thread »
| Thread Tools | |
| Display Modes | |
| |
| | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Where do the fonts live that browsers use? | CoolBee | Technology & Technical Skills | 12 | 03-19-2010 06:56 AM |
| Rant about the backspace behaviour in web browsers | Plays With Life | Technology & Technical Skills | 12 | 10-23-2009 09:18 AM |
| Using portable browsers | Lupe | Technology & Technical Skills | 1 | 09-04-2009 07:30 PM |
| Adobe Flash Crashes Multiple Browsers | tstesen | Technology & Technical Skills | 7 | 04-23-2009 02:47 PM |
| Consiousness hierarchy | Adelina | Spirituality, Consciousness, & Awareness | 5 | 08-31-2008 08:55 PM |
All times are GMT. The time now is 10:33 PM.




