Hello i have my site hosted on Hostinger and i enabled it to force HTTPS, so when people writes http://example.com it goes to https://example.com. I have an API that handles a POST from my program. I already have my api handling requests but i don't know how to "filter" HTTPS. Right now any request (http or https) are accepted by my API, but i want it to ignore or block HTTP request, and only answer to HTTPS.
@edit: Used suggestions on comments and came with the following: RewriteEngine on RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
When i do an HTTPS request it works, but when i do an HTTP request, it makes the request but when i echo the variables sent on the body, they are empty.