Follow us on Twitter!
Understanding is the answer, hatred is the problem, and hackers are the slaves abused and destroyed in the process of peace online - Deshouleres
Thursday, April 24, 2014
Navigation
Home
HellBoundHackers Main:
HellBoundHackers Find:
HellBoundHackers Information:
Learn
Communicate
Submit
Shop
Challenges
HellBoundHackers Exploit:
HellBoundHackers Programming:
HellBoundHackers Think:
HellBoundHackers Track:
HellBoundHackers Patch:
HellBoundHackers Other:
HellBoundHackers Need Help?
Other
Members Online
Total Online: 16
Guests Online: 14
Members Online: 2

Registered Members: 82893
Newest Member: mor-amit
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: 1003
Location: Eh?
Joined: 10.04.09
Rank:
Mad User
Posted on 09-04-11 05:49
Method 1: index.php file that silently returns 404

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





Method 2: Using .htaccess

Code
<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.stealt. . .

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