/    Sign up×
Community /Pin to ProfileBookmark

General Web Site Question

Alright so right now a person can type my url and a folder name and access the directory. This is NOT GOOD. How do i set it so it redirects to a 404?

to post a comment
PHP

6 Comments(s)

Copy linkTweet thisAlerts:
@savvykmsAug 31.2010 — You could always make a fake index.html/php whatever and throw it into the directories you want blocked off, it is a cheap and flawed method, but it turns back most people. Another method is to password protect directories or set up redirection. It depends on your web server, be it the Apache web server, a Microsoft one, or some other httpd.
Copy linkTweet thisAlerts:
@NogDogAug 31.2010 — If it is running on Apache, you can either change the Apache settings or use a .htaccess file in the web root directory to disallow directory listings:
<i>
</i>Options -Indexes
Copy linkTweet thisAlerts:
@ky0ungauthorAug 31.2010 — Thanks guys!

Is that all I have to do with the htaccess file?
Copy linkTweet thisAlerts:
@NogDogAug 31.2010 — That's all you need in it for this issue.
Copy linkTweet thisAlerts:
@Jarrod1937Sep 01.2010 — If they are just include files you can also throw in a "deny from all" into the htaccess to make the files inaccessible even if someone knows the filename (or could guess it).
Copy linkTweet thisAlerts:
@savvykmsSep 01.2010 — If they are just include files you can also throw in a "deny from all" into the htaccess to make the files inaccessible even if someone knows the filename (or could guess it).[/QUOTE]

Good idea, I forgot about good old ACLs, which is odd, considering I just spent two years in a school learning about them every other week in a networking course.
×

Success!

Help @ky0ung spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...