Website hidden files?

Everything else that doesn't fall into one of the other PB categories.
MachineCode
Addict
Addict
Posts: 1482
Joined: Tue Feb 22, 2011 1:16 pm

Website hidden files?

Post by MachineCode »

If I'm hosting a website, say at www.example.com, and it has a subfolder named "files", can anyone find out which files are inside it somehow, if they DON'T know the filenames? So for example, if there are these files in there:

http://www.example.com/files/John.txt
http://www.example.com/files/Billy.txt
http://www.example.com/files/Karen.txt

Can anyone see this list of files? If so, how can I hide them, but make each one accessible to someone who knows the names? I don't want to use a password system, if possible.
Microsoft Visual Basic only lasted 7 short years: 1991 to 1998.
PureBasic: Born in 1998 and still going strong to this very day!
c4s
Addict
Addict
Posts: 1981
Joined: Thu Nov 01, 2007 5:37 pm
Location: Germany

Re: Website hidden files?

Post by c4s »

Normally the files would be visible by visiting "http://www.example.com/files/". So either put an empty index.php file in this folder or even better: If you can edit your .htaccess file add "Options -Indexes" to it.
If any of you native English speakers have any suggestions for the above text, please let me know (via PM). Thanks!
MachineCode
Addict
Addict
Posts: 1482
Joined: Tue Feb 22, 2011 1:16 pm

Re: Website hidden files?

Post by MachineCode »

Thanks for the info. I did notice that I get a "403 - forbidden" error if I try to look into my directory, even though there's no "index.php" file in there, and no ".htaccess" file. Should I stick an empty "index.php" in anyway for good measure? Or what about "index.html"? I don't know anything about ".htaccess" so I don't want to mess with that. :oops:
Microsoft Visual Basic only lasted 7 short years: 1991 to 1998.
PureBasic: Born in 1998 and still going strong to this very day!
c4s
Addict
Addict
Posts: 1981
Joined: Thu Nov 01, 2007 5:37 pm
Location: Germany

Re: Website hidden files?

Post by c4s »

The .htaccess file should be in the root directory of your account. I'm not an expert but I'd say that you're on the safe side when you get 403.
If any of you native English speakers have any suggestions for the above text, please let me know (via PM). Thanks!
Nituvious
Addict
Addict
Posts: 1033
Joined: Sat Jul 11, 2009 4:57 am
Location: United States

Re: Website hidden files?

Post by Nituvious »

You should prevent access to the folder that contains the files using .htaccess
If the files are not publicly known and there is no sitemap, the files should never be found by anyone though.
▓▓▓▓▓▒▒▒▒▒░░░░░
User avatar
freepurebasic
Enthusiast
Enthusiast
Posts: 123
Joined: Fri Sep 24, 2010 12:02 pm
Location: world wide web

Re: Website hidden files?

Post by freepurebasic »

lol guys!

.htacess is working only on apache, so if you want to deny the access to that files use .htaccess,
if you want only to hide listing use this
index.php

Code: Select all

<?php die(); ?>
(for old servers use )
index.php3
default.php
default.php3

(this are combinations you must use in case you haven't administrative rights,the server isn't your so you have no access to apache file configuration, or php.ini)

if is only a html hosting use
index.html
or
default.html
MachineCode
Addict
Addict
Posts: 1482
Joined: Tue Feb 22, 2011 1:16 pm

Re: Website hidden files?

Post by MachineCode »

Thanks for the help so far. One last question: is there a limit to the number of files that can go inside a website directory like that? It's an Apache host. I intend to use files that may app downloads from there, and was wondering if it could support like 10,000 files or more. Or should I break them down into different subdirectories?
Microsoft Visual Basic only lasted 7 short years: 1991 to 1998.
PureBasic: Born in 1998 and still going strong to this very day!
Nituvious
Addict
Addict
Posts: 1033
Joined: Sat Jul 11, 2009 4:57 am
Location: United States

Re: Website hidden files?

Post by Nituvious »

MachineCode wrote:Thanks for the help so far. One last question: is there a limit to the number of files that can go inside a website directory like that? It's an Apache host. I intend to use files that may app downloads from there, and was wondering if it could support like 10,000 files or more. Or should I break them down into different subdirectories?
That depends on your servers operating system. IIRC In windows, the only limit is hard drive space. I don't know about Linux, though.
▓▓▓▓▓▒▒▒▒▒░░░░░
Post Reply