Error 307 internal redirect

Discussion in 'Server Operation' started by sebastien133, Oct 27, 2022.

  1. sebastien133

    sebastien133 New Member

    Hi,

    I try to use a ISPCONFIG 3.2.8p1 on Debian Bullseye with http sites. I have a Pfsense with HAPROXY to intercept https and get services in http.

    My problem : when I call an adress on http, I'am always redirect to https sites that are not configurated for. Error 307 internal redirect.

    I did my tests between HAPROXY and PFSENSE, with modifying dns in /etc/hosts (on Windows) . I use simple texts files.

    As https is not configurated on ISPCONFIG, it fails and my server can't work properly. I deleted all .htaccess files, I read /etc/apache2/site-enabled/ file but I don't understand why...No idea !

    Is someone have an idea to help me solve this problem ?
    Regards,

    Sebastien133.
     
  2. pyte

    pyte Well-Known Member HowtoForge Supporter

    You can activate SSL for the ISPConfig Control Panel.

     
  3. sebastien133

    sebastien133 New Member

    Nope. You don't understand me : I want to connect web server on HTTP only on my dmz network.

    My problem is that ISPCONFIG redirect me on HTTPS while I don't want.
     
  4. sebastien133

    sebastien133 New Member

    And on static files too...
     
  5. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    Why not use ISPConfig forum?
    I
    If you have created a website in ISPConfig panel, it should only direct http to https if on the website Redirect tab "Rewrite HTTP to HTTPS" is ticked. If you get redirected to httpS without that, the redirection comes from somewhere else, not from ISPConfig.
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    Then you must have enabled the "Rewrite http to https" option on the redirect tab, it is disabled by default and you can disable it with one click in case you enabled it. If this is not enabled, then you know that the redirect does not happen by ISPConfig. E.g. such redirects are also done by most CMS systems like WordPress on their own, so don't blame ISPConfig for that behavior then.
     
  7. sebastien133

    sebastien133 New Member

    @Taleman Sorry I was thinking I was on ISPConfig forum. It's a mistake. Sorry.

    @till and @Taleman No, I don't enable "Rewrite http to https". "No flag, no redirection". I installed a Wordpress site but I delete .htaccess to be sure, test with a text file and the problem is same.

    That's why I don't understand why... I tried all I was thinking about. (nothing abnormal on /etc/apache2/site-enabled)

    I don't blame ISPConfig, I like this project and thank you for reading me Capture.PNG redirect.png .
     
  8. pyte

    pyte Well-Known Member HowtoForge Supporter

    Does this happen even when you create a "test.html" in the webspace root for wordpress.prodhomme.dev? Can you please do so for testing?

    Be aware that Wordpress has many settings that can be set for HTTP -> HTTPS redirection. See:


     
  9. till

    till Super Moderator Staff Member ISPConfig Developer

    The redirect from WordPress is not in a .htaccess file, it's in the WordPress PHP code.
     
  10. sebastien133

    sebastien133 New Member

    Hi, and sorry to take time to respond.

    All I tried failed, and finally changed my ISPCONFIG server configuration without understanding what it did and all is out now.

    So I reinstalled a simple Apache 2 server and tried to access simple HTML page with Chrome ("Hello World !"). It failed.
    I tried to acces it with Lynx and I can access. My server has a good config, it's a Chrome problem. (

    So I think HTTP Strict Transport Security (aka HSTS) may be at play because Chrome redirect me always to HTTPS whereas HTTPS is not installed on server. WTF ! :mad:

    Can it be a DNS parameter I didn't change ? I used /etc/hosts to update to local IP but who knows ? :confused:

    Thnak you for helping me, please !

    Sebastien133.
     
  11. pyte

    pyte Well-Known Member HowtoForge Supporter

  12. sebastien133

    sebastien133 New Member

    I tried your solution but it failed...

    It seems my site is in preload HSTS list. (https://hstspreload.org/)

    It can take a lot of time to unload from this list... It's stupid, I never want to be referenced on this list ! And I don't want that browsers redirect automatically to HTTPS for my site in HTTP only !
     
    Last edited: Nov 4, 2022
  13. sebastien133

    sebastien133 New Member

    Solution founded ! Eureka ! :D:D:D

    "If your localhost domain is .dev then I don't think the previously accepted answer works. The reason why is because since Chrome 63, Chrome will force .dev domains to HTTPS via preloaded HSTS.

    What this means is, .dev basically won't work at all anymore unless you have proper signed SSL certificate -- no more self signed certificates allowed! Learn more at this blog post.

    So to fix this issue now and to avoid this happening again in the future .test is one recommended domain because it is reserved by IETF for testing / dev purposes. You should also be able to use .localhost for local dev."

    https://stackoverflow.com/questions/25277457/google-chrome-redirecting-localhost-to-https
     
    pyte and till like this.
  14. pyte

    pyte Well-Known Member HowtoForge Supporter

    Thank you for reporting back! Good to know :)
     

Share This Page