Help - Search - Members - Calendar
Full Version: Just one more question
Hostony Board > General Support > General Support
szik3
How do you fix it so that when you enter your site, it is your own html page, instead of that folder directory with "parent directory. Thank you for you last post.
Pantera
Hope, this will be helpfull wink.gif
------------------------------------------------------------------------------------------------
Q&D Folder Restriction (security)
There are a few solutions to the problem of preventing access to errant visitors viewing folders (and their content) that are without an index file.

The solution below is one that I've found to be elegant and easy to implement. In addition, you can author a nice "error" message if you wish, AND, it can save some considerable space and time.

It is derived from the Apache DirectoryIndex function.

****

1.) Add the following line to your .htaccess file:



code:--------------------------------------------------------------------------------DirectoryIndex index.shtml index.htm index.html index.cgi index.php /restrict.html--------------------------------------------------------------------------------


2.) You may place any file name, that your particular system has been set up to default to, in that line (that you know are absent from a folder(s) that you don't want to be viewable).

* See Notes Below

3.) Next, create a "restrict.html" file, in the same folder as the .htaccess file (unless you change the path in the line above), and populate it with whatever message you want an errant visitor to see.... such as: Sorry! You are not authorized to view this directory's contents. Contact: webmaster@yoursite.com

4.) What the above all does, is: When a user types in an address to a folder that does not contain one of the files you specified in the .htaccess file line, or, specifically types in one of the files specified (which aren't there), it will redirect them to the restrict.html file. If the user typed in a /folder/filename that IS there, it will of course be rendered.

****

* Notes:

By "any file name, that your particular system has been set up to default to", I mean that, our esteemed system administrators most likely have set up our OS to look for a default file name(s), in a particular order, in the case that no filename was typed in the URL (such as your URL without the "index.htm" appended - http://www.yourdomain.com/).

For example, the order might be:

index.htm -> index.html -> default.htm -> index.shtml

So then:

User types in "www.yourdomain.com/fred/" ->
System looks for /fred/index.htm
If the system finds it, it gets rendered in the users browser ->
If the system doesn't find it, it next looks for /fred/index.html
If the system finds it, it gets rendered in the users browser ->
If the system doesn't find it, it next looks for /fred/default.htm
If the system finds it, it gets rendered in the users browser ->
If the system doesn't find it, it next looks for /fred/index.shtml
And so on... until it either finds one of it's defaulted filenames - or - finds none of it's defaulted filenames and then either presents a 404 error page - or - displays the contents of the /fred/ folder for all the world to see.

-----------------------------------------------------------------------------------------------
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2024 Invision Power Services, Inc.
IPS Driver Error

IPS Driver Error

There appears to be an error with the database.
You can try to refresh the page by clicking here