Forcing HTTPS over HTTP
You can leave it in the root directory but change it to:
RewriteRule ^(your-directory/.*)$ https://www.yourdomain.com/$1 [R,L]
Keep in mind, though, that before the redirect happens, the cookies and query parameters with possibly sensitive data has already been sent in clear text, so remember to use the secure cookie atribute if you use cookies.
force http instead of https only for a particular file
Your question is not very clear but try this .htaccess code:
Options +FollowSymLinks -MultiViews
RewriteEngine on
RewriteCond %{QUERY_STRING} ^parameter1=.*$ [NC]
RewriteCond %{HTTPS} !=on
RewriteRule ^test\.php/?$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L,QSA,NC]
This will redirect ONLY if QUERY string parameter1=something
is present in the original URL. If you want to redirect all /test.php
URIs to https then remove the 1st RewriteCond line.
Spring Boot Security using http instead of https when forwarding to login page
You should configure the ALB to terminate SSL (i.e. register certificate etc). If this is configured correctly, the ALB will automatically add a header (X-Forwarded-Proto) that tells Spring Security that it needs to use HTTPS for its redirects.
Related Topics
How to Iterate Over Non-English File Names in PHP
Avoiding Form Resubmit in PHP When Pressing F5
Using If(Isset($_Post['Submit'])) to Not Display Echo When Script Is Open Is Not Working
How to Return Back Twice in Laravel
Fastest Way to Add Prefix to Array Keys
Symfony2 - Assetic - CSS Font Icons
Custom Order Status Background Button Color in Woocommerce 3.3 Admin Order List
Why Do Changes to Some PHP Files Take So Long to Show on the Live Site
How to Check Which PHP Extensions Have Been Enabled/Disabled in Ubuntu Linux 12.04 Lts
Get Numbers from String with PHP
PHP Simplexml: Insert Node at Certain Position
Php: Using Domdocument Whenever I Try to Write Utf-8 It Writes the Hexadecimal Notation of It
Differencebetween the PHP Open Tags "<=" and "<Php"/"<"
Get All Instances of a Class in PHP