target40.cf
SSL not redirecting automatically
(I have a ssl certificate for above mentioned site but and my base URL is also redirected to https and it’s working fine but problem is that when I only enter target40.cf or http://target40.cf it doesn’t redirect to https.)
Please tell me how to fix this
KangJL
February 10, 2021, 4:34pm
2
Welcome, pls read…
In short, add these to your .htaccess file (inside htdocs directory)
RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} =http
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
3 Likes
Maybe format it like…
RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} =http
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
How to redirect to https
Go to htdocs
ad create a file called .htaccess
and then put the following contents:
RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} =http
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
But it shows too many redirects
I created but it shows too many redirects
Ah. Then you might need write this:
RewriteEngine On
RewriteCond %{SERVER_PORT} !^433$
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=302]
It still says too many redirects
For your information my base URL is set to https if need
Oh, I just realized I made a mistake. Read the edited post.
system
Closed
March 2, 2021, 8:46pm
13
This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.