R
R
rustem_ck2015-08-10 23:02:55
Apache HTTP Server
rustem_ck, 2015-08-10 23:02:55

How to redirect HTTP to HTTPS under the following conditions?

Good evening.
I apologize in advance for a possibly strange question that requires googling, but I've been rereading it for a long time, but it's still not clear.

There is an altorouter library (altorouter.com) which uses the following .htaccess:

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . index.php [L]

I have already tried various conditions, but I just can’t figure out how to make the above described .htaccess redirect to https-URL when entering the http-URL of the site?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Burov, 2015-08-10
@BuriK666

RewriteEngine on

RewriteCond %{HTTPS} off
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . index.php [L]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question