Recently, I requested a new ssl certificate. HTTPS does work, but if you type in http, it won’t redirect to the https one. I am using the InfinityFree Free SSL certificates.
I tried cloudflare recently, but it says I need to have a top private domain (www.example.com ) not (.rf.gd)
Is there another way I can redirect to HTTPS
Thank you, but I am getting an error message saying:
500 Error, please check your php script / enable display_errors in your cpanel
Also, my code is:
#Redirect to https
RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} =http [OR]
RewriteCond %{HTTP:X-Forwarded-Proto} =“”
RewriteRule (.*) https://%{(HTTP HOST}%{REQUEST URI} [R=301,L]
Header always set Content-Security-Policy “upgrade-insecure-requests;”
KangJL
November 16, 2020, 5:38pm
4
Just add
php_value display_errors On
to .htaccess will do
KangJL
November 16, 2020, 5:40pm
6
At the very beginning of .htaccess
before here: <IfModule mod_rewrite.c>
here’s the code:
php_value
display_errors
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} =http [OR]
RewriteCond %{HTTP:X-Forwarded-Proto} =""
RewriteRule (.*) https://%{(HTTP HOST}%{REQUEST URI} [R=301,L]
Header always set Content-Security-Policy "upgrade-insecure-requests;"
</IfModule>
still says 500 Error, please check your php script / enable display_errors in your cpanel
arrgh. same error here’s the code i entered in /htdocs/.htaccess
php_value display_errors On
#Redirect to https
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} =http [OR]
RewriteCond %{HTTP:X-Forwarded-Proto} =""
RewriteRule (.*) https://%{(HTTP HOST}%{REQUEST URI} [R=301,L]
Header always set Content-Security-Policy "upgrade-insecure-requests;"
</IfModule>
KangJL
November 16, 2020, 5:55pm
13
I dun see the error. Can you clr your browser cache?
thanks it helped. I made a few edits to the code:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
1 Like
system
Closed
December 1, 2020, 6:14pm
16
This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.