h5bp / server-configs-apache

Apache HTTP server boilerplate configs
MIT License
3.21k stars 636 forks source link

Apache Errordocument 404 not working and get instead "Page redirection" #133

Closed cizario closed 6 years ago

cizario commented 6 years ago

hi, i uploaded the last html5boilerplate v6 to my OVH VPS running Apache v2.4.6 on Centos 7 i didn't modify any code yet and i got the default page Hello world! This is HTML5 Boilerplate. but when it comes to test 404 error page i got Page redirection: Check your URL i even didn't got the default Apache 404 Error Not Found Not Found The requested URL /blabla was not found on this server. it seems like there was a proxy responding when errors occurs (even 500 error, i tested it). i didn't configured my Apache server as Proxy. i even tried to comment all related proxy's modules on /etc/httpd/conf.modules.d/00-proxy.conf but seems nothing changed.

and this is MYSITE conf

<VirtualHost *:80>
  ServerName www.MYSITE.com
  ServerAlias MYSITE.com
  ServerAdmin support@MYSITE.com

  DocumentRoot /home/USER/www/MYSITE.com

  ErrorLog /var/log/httpd/MYSITE.com-error_log
  CustomLog /var/log/httpd/MYSITE.com-access_log common

  <Directory /home/USER/www/MYSITE.com>
   Options Indexes Includes FollowSymLinks MultiViews
   AllowOverride All
   Order allow,deny
   Allow from all
   Require all granted
  </Directory>
</VirtualHost>

i really appreciate your help, and i really apologize if that was duplicated post.

LeoColomb commented 6 years ago

@cizario Thanks for this detailed report! 👍 That said, I suspect this issue to be more related to your own configuration than the H5BP one.

I see you added ErrorLog and CustomLog. What are the outputs when you "request" a 404?

cizario commented 6 years ago

@LeoColomb thnx for your quick reply and yes i confirm the issue is related to my own config not to H5BP, as i said it's fresh and bare installation of H5BP, i didn't add any php code or whatever and i already looked at ErroLog but /var/log/httpd/MYSITE.com-error_log was empty and /var/log/httpd/MYSITE.com-access_log seems logging nothing weird :

@myipadr - - [25/Jan/2018:16:49:43 +0100] "GET /blabla HTTP/1.1" 404 203

in fact, i have 2 Laravel 5.5 projects running independently but when it comes to http errors (4xx 5xx) Laravel didn't render its default errors view as it should be (404 and 503 for maintenance mode) so i'm using the default H5BP project to test my server behavior/config (htaccess). but each time when any http error is thrown i got Page redirection with this simple html :

<html>
<head>
  <title>Page de redirection</title>
</head>
<body>
  <h1>Veuillez verifier votre URL</h1>
</body>
</html>

i even didn't got the known default Apache error. it seems there was proxy which takes over.

i'm sure i didn't configure any proxy on my OVH VPS.

i just installed LAMP sever following Digital Ocean's tutorial. it was bare minimal secure installation there's not advanced configs and every thing works fine (phpmyadmin ... ) except returning the appropriate errors.

any idea ? what i'm missing in my htaccess / conf ?

LeoColomb commented 6 years ago

As the output HTML is written in a mistaken french (mdr, ça sort d'où ? 😆), I'm now sure this is fully related to a custom configuration. "Custom" means changed by you or changed by your host.

I suggest you to contact OVH support to resolve your situation.


Closing as out of scope of this repo.

cizario commented 6 years ago

@LeoColomb it's really ridiculous, i SIMPLY changed my public @ip and every thing works like a charm. it was my ISP proxy cache. D**n; it costs me 6 days to figure it out ... and my client won't pay me for that.

http://www.pdproxy.com/blog/is-your-isp-using-a-transparent-proxy-32.htm