Auto redirect to https - how it works?


#1

(Noob!)
apache 2.4.10, ubuntu 15.04
What and where is LE write redirect rules?
Can’t figure out how undo reedirect rule now.


#2

The rules will be written into the files in /etc/apache2/sites-available/ ( exactly which files in there depends if you have only one domain, of multiple domains / virtual hosts.


#3

Commented all Redirect rules, but it’s still working.


#4

You may need to clear your browser cache for that domain ( as it was probably a 301 redirect, that the browser has cached / remembers).


#5

Hello @paleale,

If you removed the Rewrite and Redirect rules and reloaded apache maybe the redirect is being performed directly by your browser because in your conf you activated HSTS. If that is the case you should see something like this:

Header always set Strict-Transport-Security ....

As I said, even if you removed this line in your apache config, your browser will try to access your site using https during the max-age time that you configured. Try it with another browser (fresh installation) or remove your browser’s cache completely.

Cheers,
sahsanu


#6

Here it is! That was cache. Thanks!


#7

Setting max-age=0 should also clear it.