Redirect HTTPS to HTTP using .htaccess

0

Operating system: ubuntu 14. Web server: apache2.

Friends, I already researched this and can not redirect the url, which is inserted with the https protocol, for the same url, only with http.

The opposite is easy for me to use .htaccess (http for https).

I know that by default, .htaccess has been disabled in Ubuntu14 + apache2. I already enabled it and it is already working properly.

My certificate is self-signed. My tests (https-> http) are done with active or disabled SSL. From the same: if enabled, the browser displays the invalid certificate screen; if disabled, the browser can not establish the connection to the web server, the url, in both cases, remains in https after it is inserted.

    
asked by anonymous 17.12.2014 / 22:47

1 answer

1

On sites where I want to force the user to always access the HTTP version instead of HTTPS, we do this:

<VirtualHost *:443>
    ServerName site.com.br
    Redirect permanent / http://site.com.br/
</VirtualHost>

However, I make this change in the virtual host configuration, not the .htaccess . But I think for .htaccess is the same rule.

    
18.12.2014 / 12:27