Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar Mark Forums Read
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 12-18-2005, 05:31 PM   #1
spacedog
Yes that IS me. Bitch.
 
Industry Role:
Join Date: Nov 2001
Posts: 14,149
how to block access to certain files?

ok, here's a question I need some help with.

say I have domain.com/directory/
and in that directory is subdirectory images
subdirectory cgi bin & a few more subdirectories & in directory is html files & some php & .txt & the .css & some scripts

so, domain.com/directory/images
and domain.com/directory/cgi_bin
domain.com/directory/page10.php
domain.com/directory/page10.css

ok, now lets say visitor goes to domain.com./directory/page10.php and he cuts out page10.php so that it shows domain.com/directory & now he see's everything in that directory. What do I do so that people can not access this.

also, I want to deny access to all the scripts, php files & .css & denie access to anything at all that is not an html page or image
How can I block everyone out except for myself.

Last edited by spacedog; 12-18-2005 at 05:32 PM..
spacedog is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-18-2005, 05:58 PM   #2
porncaster
Registered User
 
Join Date: Oct 2005
Posts: 39
for the record, what you want to do is called blocking directory listing.

ill assume that youre running apache because if youre not, you should be. if you are on shared hosting, forget about the first procedure below and hope that .htaccess is enabled for you. if its not, contact the server admin and ask him to enable it.

if you have access to apaches config file (httpd.conf) and you want to disable directory listing for your ENTIRE server:
- open httpd.conf
- search for <Directory "!webroot!"> where !webroot! is the folder that your html files for the above mentioned domain.com are in (ie. /var/www/html or c:\apache2\htdocs)
- look for a line that says 'Options Indexes FollowSymLinks' immediately after the above line. Remove 'Indexes'.
- restart apache

if you dont have access to httpd.conf, or dont want to turn off directory listing for your entire server, and you have .htaccess enabled:
- in domain.com/directory create a file named .htaccess
- add a single line 'Options FollowSymLinks' and save your changes

if you want to use .htaccess but the above doesnt seem to work, and you have access to httpd.conf:
- find <Directory "!webroot!"> as in the first procedure
- find the following line 'AllowOverride None' and change to 'AllowOverride All'
- restart apache
- do the second above procedure

sick of this yet?

more reading:
http://httpd.apache.org/docs/1.3/howto/htaccess.html
http://javascriptkit.com/howto/htaccess11.shtml

ill get back at you in this thread on the denying access thing. that is a related but potentially an even bigger pain than blocking directory listing.

can you post the vitals on your hosing (shared or not) and software?
__________________
Porncaster.net : Let the porn come to you!!
porncaster is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-18-2005, 06:02 PM   #3
Nookster
Confirmed IT Professional
 
Industry Role:
Join Date: Nov 2005
Location: Hollywood, CA
Posts: 3,744
another work around is using php for redirection.
Code:
<?php
   header("Location: http://www.mysite.com");
?>
Save that above code as index.php and upload it into whichever directory you don't want them to be able to see the structure of. "mysite.com" will of course be where you want them to be redirected to.
Nookster is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-18-2005, 06:18 PM   #4
spacedog
Yes that IS me. Bitch.
 
Industry Role:
Join Date: Nov 2001
Posts: 14,149
it is shared hosting, I do have htaccess & it is unix.
I did the htaccess & it denied the scripts in another directory access to files in the directory I tried blocking.
spacedog is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-18-2005, 06:18 PM   #5
spacedog
Yes that IS me. Bitch.
 
Industry Role:
Join Date: Nov 2001
Posts: 14,149
Quote:
Originally Posted by Nookster
another work around is using php for redirection.
Code:
<?php
   header("Location: http://www.mysite.com");
?>
Save that above code as index.php and upload it into whichever directory you don't want them to be able to see the structure of. "mysite.com" will of course be where you want them to be redirected to.
I'm trying this right now. this should work
spacedog is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-18-2005, 06:27 PM   #6
spacedog
Yes that IS me. Bitch.
 
Industry Role:
Join Date: Nov 2001
Posts: 14,149
and it did work thanks nookster
And thank you porncaster for the links. some good info there

ok, now, only thing it does not block is the .css & .js

when I type in the url to the .css I get a save prompt. what can I do so that people are not able to download my .css & .js files
spacedog is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-18-2005, 06:33 PM   #7
Oracle Porn
Affiliate
 
Oracle Porn's Avatar
 
Industry Role:
Join Date: Oct 2002
Location: Icq: 94-399-723
Posts: 24,433
god damn youve been here since 2001 and you dont know basic shit?
what the fuck have you been doing?
__________________


Oracle Porn is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-18-2005, 07:11 PM   #8
spacedog
Yes that IS me. Bitch.
 
Industry Role:
Join Date: Nov 2001
Posts: 14,149
Quote:
Originally Posted by Oracle Porn
god damn youve been here since 2001 and you dont know basic shit?
what the fuck have you been doing?

what's so basic about it?

i have directories & subdirectories & scripts that are dependant on files withing the root, the directories & the subdirectories & when I tried blocking via method above, it denied the script access to the files.

mod rewrite & htaccess & server config. are NOT basic to me.

I inserted the index.php as above, & it denies the script access to the css
I want to deny users from seeing the files in directories, but want the scripts to be able to read the files. I also do not want users to be able to print, download or view my .css & .js files
spacedog is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks
Thread Tools



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.