Redirect HTTPS to HTTP using . htaccess

Asked

Viewed 1,984 times

0

Operating system: Ubuntu 14. Web server: apache2.

Friends, I already searched on this and I can’t redirect the url, which is inserted with the https protocol, to the same url, only with http.

Otherwise I can easily use . htaccess (http for https).

I know that, by default, the . htaccess has its functioning disabled in Ubuntu14 + apache2. I have enabled it and it is already working correctly.

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

  • http://answall.com/questions/15514/redirecionar-site-https-para-http?rq=1?

  • Thanks for the page indication, but I had already seen it earlier. The code insert shown on . htaccess did not work. I think my problem is not in . htaccess, since I can successfully http to https.

1 answer

1

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

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

However, I make this change in the virtual host configuration, not in the .htaccess. But I believe that for the .htaccess be the same rule.

  • Rodrigo, I tried to add the [redirect Permanent] in 2 files that are brought in my ubuntu14: 000-default.conf and default-ssl.conf. They bring configurations to the virtual host. But I haven’t yet. Thanks for the help.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.