Welcome to HBH! If you have tried to register and didn't get a verification email, please using the following link to resend the verification email.

404 with a directory that exists?


ghost's Avatar
0 0

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.


spyware's Avatar
Banned
0 0

Either it's set in the httpd (apache) configuration, or set in .htaccess, or it's just an imposter index. I bet if you would search for this shit on the internet, you would've answered your own question by now.


ghost's Avatar
0 0

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? ;)


spyware's Avatar
Banned
0 0

Sounds like you need to learn how to search, not how to force return a 404 page.

Also, I'm sure that this subject is covered in, for example, the apache manual.


ghost's Avatar
0 0

Alright then, well it sounds like you need to learn how to use constructive criticism, not being an ass.

So with that, unless someone else has anything to say that is related to my posted question, that does not involve why I am asking it, I am outa here!

Cheers ;)


spyware's Avatar
Banned
0 0

How about you go fuck yourself?


ghost's Avatar
0 0

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.


spyware's Avatar
Banned
0 0

No, seriously, did you miss the myriad of pointers I gave you a few posts back?


techb's Avatar
Member
0 0

spyware gave you what you needed. Now, all you need to do is read until you find the answer.


Mtutnid's Avatar
Member
0 0

Spyware did help you in a very nice way. You should learn to read before learning to search.


ghost's Avatar
0 0

what a chain…. learn to read > search > return a 404 error. :angry:

not that I'm criticizing you BlackRat79, just summarizing what was said here.


techb's Avatar
Member
0 0

Oh, I forgot to mention; google, bing, yahoo, lmgtfy then read your results. Then you should have your answer.

RECAP: search, read, apply. :D


starofale's Avatar
Member
0 0

techb wrote: Oh, I forgot to mention; google, bing, yahoo, lmgtfy Dont forget DuckDuckGo and lmddgtfy


ghost's Avatar
0 0

starofale wrote: Dont forget DuckDuckGo and lmddgtfy

dude! why haven't I heard about this! thanks! :)


ghost's Avatar
0 0

Thank you HacKid for being the only one to actually post something relevant instead of mimicking spyware because if he does it, it's safe to pile on, have a community point.


starofale's Avatar
Member
0 0

@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.


ghost's Avatar
0 0

@starofale And you are absolutely adorable :D It's so cute when you project due to something I never said <3


starofale's Avatar
Member
0 0

COM wrote: @starofale And you are absolutely adorable :D Thank you COM :happy: Did I not understand your post correctly then?


ghost's Avatar
0 0

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.


stealth-'s Avatar
Ninja Extreme
0 0

Method 1: index.php file that silently returns 404

         /* index.php */
         header(&#39;HTTP/1.0 404 Not Found&#39;);
?&gt;

Method 2: Using .htaccess

    Order allow,deny
    Deny from all
&lt;/FilesMatch&gt;

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.