U
U
UnrealNatural2016-01-14 21:28:40
PHP
UnrealNatural, 2016-01-14 21:28:40

Htaccess redirect from http to https?

Good afternoon. There is a site. It has an htaccess file. There was this code:

AddDefaultCharset UTF-8
RewriteEngine On
RewriteRule ^([A-Za-z0-9-/]+)$ /index.php?page=$1 [L]

With the help of these commands, I get a site.ru/page=game redirect to site.ru/game
I put an SSL certificate on the site and redirect http to https is
required I rummaged through the internet and found this code:
RewriteEngine On
RewriteCond %{HTTPS} =off 
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [QSA,L]

Everything works great.
But now we need to combine it:
RewriteEngine On
RewriteCond %{HTTPS} =off 
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [QSA,L]
RewriteRule ^([A-Za-z0-9-/]+)$ /index.php?page=$1 [L]

This doesn't work( Loop Forwarding...
Asked 7 minutes ago 14 views

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
shell_execute, 2016-01-17
@shell_execute

Why don't you enable forced HTTPS?
stackoverflow.com/questions/4398951/force-ssl-http...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question