apache forward https request to http

Questions related to the Apache server
Post Reply
mister_v
Posts: 200
Joined: Thu Mar 04, 2010 9:19 pm

apache forward https request to http

Post by mister_v »

hi,

I (still) have a website with no ssl certificate, so only http.
As most browser now automatically forward to https when typing just the url,
It is a problem.
As I host several site son the same server (same ip, port)
it automatically does to the main site. Not the site intended with the url name.

How do I fix this ?
chris
Site Admin
Posts: 209
Joined: Mon Jul 21, 2008 9:52 am

Re: apache forward https request to http

Post by chris »

Simplest way edit the site conf file in
nano /etc/apache2/sites-available/000-example.com.conf

and add or update:

Code: Select all

<VirtualHost *:443>
        ServerName www.example.com
        redirect permanent / http://www.example.com/
</VirtualHost>
This will redirect and https://www.example.com to http://www.example.com

Don't forget to restart apache.

Code: Select all

etc/init.d/apache2 restart
Post Reply