Mobile app version of vmapp.org
Login or Join
Hamaas447

: Would this .htaccess alone cause 404 and 500 errors? My site is down and depending on what I change I get a 500 error or a 404 or a "Forbidden you are not authorized" error. In checking

@Hamaas447

Posted in: #Cpanel #Htaccess #HttpCode500

My site is down and depending on what I change I get a 500 error or a 404 or a "Forbidden you are not authorized" error. In checking my .htaccess files I found a strange one:

<IfModule !mod_authz_core.c>
Order deny,allow
Deny from all
</IfModule>
<IfModule mod_authz_core.c>
Require all denied
</IfModule>


Would "Deny from all" and "Require all denied" be the reason my site is down? It seems like this would be the cause, right?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Hamaas447

1 Comments

Sorted by latest first Latest Oldest Best

 

@Ogunnowo487

I get a 500 error or a 404 or a "Forbidden you are not authorized" error.


The code you posted should result in a 403 Forbidden for all visitors. The first <IfModule> block applies to Apache 2.2 (and below) and the second block applies to Apache 2.4+ (strictly Apache 2.3+). Although the first block alone would "work" on both Apache 2.2 and 2.4 if you removed the <IfModule> wrapper.

I say "should", because, whatever error document is being served when the 403 is triggered could change the HTTP status to something else. Sometimes a 404 might be preferable to a 403 and sometimes the server is simply misconfigured.

You also shouldn't be getting different errors with the same block of code.


Would "Deny from all" and "Require all denied" be the reason my site is down?


If that is the only code in your .htaccess file then yes, that would certainly be one big reason! However, that code is quite deliberate and looks a bit dubious since it is specifically targeting multiple server versions.


...depending on what I change


What things were you changing?

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme