Answer the question
In order to leave comments, you need to log in
What needs to be written in htaccess to redirect to https?
I use vps server reg.ru. According to the guide, I set up ssl on the server and the end says
After installing SSL, set up a redirect from HTTP to HTTPS. The redirect for Apache is configured through the .htaccess file.
RewriteEngine On
RewriteCond %{SERVER_PORT} !^443$
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI } [R=301,L]
RewriteEngine on
RewriteRule ^$ public/ [L]
RewriteRule ((?s).*) public/$1 [L]
RewriteEngine on
RewriteRule ^$ public/ [L]
RewriteRule ((?s).*) public/$1 [L]
RewriteEngine On
RewriteCond %{SERVER_PORT} !^443$
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^(.*)$ public/$1 [L]
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} !^public [L,R=301]
</IfModule>
Answer the question
In order to leave comments, you need to log in
Then just don't scold the framework when your data is stolen or hacked. Apache and dumping code into a root document - how is it possible in 2022?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question