apache - Block access to http version, not https version? -


I'm looking at creating a relay rule everywhere that only applies to http: // versions of the website and Not http: // version.

Actually, for a login page, I am trying to block all access to the http version so that the user is forced to enter through a secure page.

In my case, the example is:

  http://shop.example.com/admin (blocked) https://shop.example.com/admin ( Access)   

Can anyone help me with this? And if I am searching for the wrong keywords, please do not lower my score just what advice I have and I will remove this question and continue my searches. I therefore have only an index.php file and an .htaccess file for the entire website?

Enter this code in your DOCUMENT_ROOT / .htaccess file:

  Reviving OnRightConnect% {HTTPS} Close ReversionContact% {HTTP_HOST} ^ Shop \ .example \ .com $ [NC] Rewrite Rule ^ admin - [F, NC]   

This will return the forbidden error to all http://shop.example.com/admin requests

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -