apache directives in .httpaccess file

Discussion in 'ISPConfig 3 Priority Support' started by Bob Hall, Nov 21, 2019.

  1. Bob Hall

    Bob Hall New Member HowtoForge Supporter

    Greetings;

    I have a customer who has a website. they want any requests for https://<domain name/somelink/some file> to redirected http://<domain name/somelink/some file> auto-majically. I've tried to add the following to the .httpaccess file in their web directory but even after rebooting the server it does not seem to work. Any advise on how to achieve this would be greatly appreciated.

    # Redirect HTTPS to HTTP
    RewriteCond %{HTTP:X-Forwarded-Proto} =https
    RewriteRule ^(.*)$ http://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

    Thanks;
    Bob
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Try this instead:

    RewriteEngine On
    RewriteCond %{HTTPS} on
    RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
     

Share This Page