HighDots Forums  

.htaccess file to prevent listing of directories.

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss .htaccess file to prevent listing of directories. in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Mike Zagorski
 
Posts: n/a

Default .htaccess file to prevent listing of directories. - 07-08-2003 , 11:06 AM






I created a .htaccess file to prevent people from browing some of my
directories. The file contained:

IndexIgnore *.gif *.jpg

When I then go to view my website the images dont display. How can I prevent
directory browsing while allowing the images to still be viewed within a
webpage?

Thanks

Mike



Reply With Quote
  #2  
Old   
Alan Ames
 
Posts: n/a

Default Re: .htaccess file to prevent listing of directories. - 07-08-2003 , 11:23 AM






http://www.google.com/search?hl=en&ie=ISO-8859-1&q=.htaccess+directory+brows
ing

delete the line you have, and put in

Options -Indexes

then if you want to get fancy- you could put a custom 403 document in. Or do
a redirect for 403 errors to send them to a different page like the main
index.


Quote:
I created a .htaccess file to prevent people from browing some of my
directories. The file contained:

IndexIgnore *.gif *.jpg

When I then go to view my website the images dont display. How can I prevent
directory browsing while allowing the images to still be viewed within a
webpage?

Thanks

Mike


--
Team Macromedia Volunteer for Dreamweaver
Certified Dreamweaver MX Developer



Reply With Quote
  #3  
Old   
Gary White
 
Posts: n/a

Default Re: .htaccess file to prevent listing of directories. - 07-08-2003 , 12:06 PM



On Tue, 8 Jul 2003 16:06:57 +0100, "Mike Zagorski"
<mike (AT) nospammikezagorski (DOT) com> wrote:

Quote:
I created a .htaccess file to prevent people from browing some of my
directories. The file contained:

IndexIgnore *.gif *.jpg

When I then go to view my website the images dont display. How can I prevent
directory browsing while allowing the images to still be viewed within a
webpage?
Assuming that you're on an Apache server, add this to your .htaccess
file instead of the line you used:

Options -Indexes


Gary


Reply With Quote
  #4  
Old   
Michael Fesser
 
Posts: n/a

Default Re: .htaccess file to prevent listing of directories. - 07-08-2003 , 12:15 PM



Mike Zagorski tat wo schreiben:

Quote:
I created a .htaccess file to prevent people from browing some of my
directories. The file contained:

IndexIgnore *.gif *.jpg

When I then go to view my website the images dont display. How can I prevent
directory browsing while allowing the images to still be viewed within a
webpage?
I put a file 'index.html.php' in such directories with following
content:

<?php
header("Location: http://".$_SERVER['HTTP_HOST']."/403.html");
?>

If a user tries to access the directory without giving a filename it
will print a customized '403 - Forbidden' message.

You need PHP for this and the server has to be configured with
MultiViews turned on (e.g. Options +MultiViews in .htaccess).

Micha


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.