Join us at IRC!
One mans freedom fighter, another's terrorist.
Tuesday, May 22, 2012
Navigation
Members Online
Total Online: 34
Web Spiders: 18
Guests Online: 32
Members Online: 2

Registered Members: 70159
Newest Member: dbarker
Latest Articles
View Thread

HellBound Hackers | Computer General | Webmasters Lounge

Page 2 of 2 < 1 2
Author

RE: 404 with a directory that exists?

stealth-
Member



Posts: 995
Location: Eh?
Joined: 10.04.09
Rank:
God
Posted on 09-04-11 05:49
Method 1: index.php file that silently returns 404

<?php
/* index.php */
header('HTTP/1.0 404 Not Found');
?>


Method 2: Using .htaccess

<FilesMatch /directory(/?|/.*)>
Order allow,deny
Deny from all
</FilesMatch>

RedirectMatch 404 ^/directory(/?|/.*)$


Method 3: Instead of putting the above code in .htaccess, it also works in the server config files perfectly fine.

Method 4: Also, yet another way would be to use Apache's mod_rewrite, instead of RedirectMatch.

There are a ton of ways to achieve what you're looking for, hopefully one of the two I mapped out for you will be to your preference. If you're still actually checking this thread, of course.


The irony of man's condition is that the deepest need is to be free of the anxiety of death and annihilation; but it is life itself which awakens it, and so we must shrink from being fully alive.
http://www.stealth-x.com

Edited by stealth- on 09-04-11 05:50
http://www.stealth-x.com
Page 2 of 2 < 1 2
Guest
Username

Password

Remember Me


Bookmark This Page
Affiliates
Adverts

 

 

Links
By using, viewing or obtaining any information contained on this site, you agree to the disclaimer.

© HellBound Hackers 2008- 2009. Since 3rd December 2004.