404 with a directory that exists?
I'm setting up my own website to play around with (nothing fancy I've always just been curious).
Anyhow, I've was experimenting with other sites for ideas and I ran across a site that gives a 404 error if I go to the directory, but there are files in the directory so it has to exist right?
I was wondering if anyone had ideas how how to recreate this. Is it a .htaccess configure or something more interesting? :)
Thanks! Rat
EDIT: On a side note, I'm also curious how to run shell commands from the html file. I know they do it in the basic challenges and I found that interesting.
Yeah…. don't you think I tried that?
Unfortunately trying to find anything DETAILED on .htaccess or httpd on google is a bit harder then a first glance gives. Including searching 404, hiding directories, configured 404, etc most of the results are complete crap or not what I need. And considering most websites guard their config files like gold, thanks to the default apache configuration, which it makes it hard to find examples. :@ (unless you have methods to sneaking a glance at a actual sites .htaccess file which I would love to know)
So, thats why I was asking a human (not a search engine) for more exact solutions to my question. Trust me, if I can find the answer online I wouldn't bother bugging you guys would I? ;)
You do realize that I am not making you reply to my post. You are winding your self up for no real reason.
If you really have a problem with me asking a simple and related question on a public forum for web construction then why not just say that? To which I would not understand seeing as my question was simple and straight to the point. In fact, I even used semi-proper grammar (compared to that of other posters).
I was under the understanding that this was the "Webmaster's Lounge"; not "The Room of Noob Haters"
Again, if anybody has anything that could poke me in the right direction I would be grateful.
Also… here's a link that might help (maybe?) http://www.webmasterworld.com/apache/3731396.htm
don't flame me if that's not the right thing. I don't know Apache or .htaccess at all. haven't started to work on it myself yet.
techb wrote: Oh, I forgot to mention; google, bing, yahoo, lmgtfy Dont forget DuckDuckGo and lmddgtfy
@COM Are you talking about DuckDuckGo?
If you are, I'm not using it becuase spyware is using it. I'm using it becuase I think it's a good search engine and it doesn't store loads of data about me.
I posted those links because not many people have heard of DuckDuckGo (as nack's post shows) and I think people would be interested in a good alternative to Google.
@starofale And you are absolutely adorable :D It's so cute when you project due to something I never said <3
COM wrote: @starofale And you are absolutely adorable :D Thank you COM :happy: Did I not understand your post correctly then?
starofale wrote: Did I not understand your post correctly then? Pretty much.
Anyhow, OP, this one's for you: If the site you're on allows for PHP or similar and you do not want to fuck about with .htaccess, then an alternative solution would be to put an index.php file in there that sends back a custom 404 header. Or whatever header you want, honestly.
Method 1: index.php file that silently returns 404
/* index.php */
header('HTTP/1.0 404 Not Found');
?>
Method 2: Using .htaccess
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.