Follow us on Twitter!
Capitalism is an Island of wealth in a sea of poverty
Tuesday, April 28, 2015
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: 15
Guests Online: 15
TeamSpeak Online : 5 Members Online: 0

Registered Members: 88088
Newest Member: ausdrifter
Latest Articles
Our sponsor needs your help!


One of our sponsors needs your help, http://www.virginmediabusiness.co.uk/pitch-to-rich/grow/krystal-hosting/
Go check out their video and Don't forget to vote !


~ Thanks for your help
HBH
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