Watani
Watani

Reputation: 23

force HTTPS to HTTP

While ago I used Cloudflare and the I used to redirect all the trafic from HTTP to HTTPS, but now due to some issues we need to shift back to HTTP, and we are no longer using Cloudflare, some of our user are still visiting the old HTTPS url and they are getting "This site can’t be reached" error we are using Apache/2.4.18 and I have tried all the suggested fixes to force all HTTPS trafic to HTTP but nothing worked here is my VirtualHost setting

<VirtualHost *:80>
ServerAdmin [email protected]
ServerName mysite.com
ServerAlias www.mysite.com
DocumentRoot /var/www/html/mysite.com
CustomLog /var/www/logs/site_Log.log combined
ErrorLog /var/www/error_logs/site_Erro.log
<Directory /var/www/html/mysite.com>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride All
            Order allow,deny
            allow from all

and here is my htaccess setting

RewriteEngine On 
RewriteCond %{HTTPS} on
RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI}

and yes mod_rewrite is enabled

Upvotes: 0

Views: 3386

Answers (1)

Watani
Watani

Reputation: 23

Ok. so this htaccess worked for me

RewriteEngine On
RewriteCond %{HTTPS} on

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

Upvotes: 1

Related Questions