Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Force HTTPS request using .htaccess [duplicate]

I have a folder with images, which should be accessed only using HTTPS. How to redirect all requests from HTTP to HTTPS?

like image 563
Paul Avatar asked Oct 15 '25 04:10

Paul


1 Answers

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

This should do it.

like image 57
Utku Zihnioglu Avatar answered Oct 16 '25 22:10

Utku Zihnioglu



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!