500 php error after insert .htaccess

I’m in trouble. I’m not use PHP.
I’m use index.html templates css and images only…
All certificates is working finely
but I cant to force all to https…
any settings i missed on cpanel maybe?

Can you please share your .htaccess code?
Maybe there is something wrong with it.

Can you share your website?
And from force what you mean?
Do you mean redirecting from http to https or you mean over https you have insecure connection?
If you mean that over https:// you have insecure connection then You will have to fix mixed contents problem. You site might be requesting contents over http instead of using https to request contents.

If you mean redirect, then you have to setup a redirect from http to https using .htaccess.

Like @adisp007 said, please share the contents of your .htaccess file, so we can see what your error is.

Are you sure it’s a PHP error? Because a syntax error in a .htaccess file will also cause a 500 Internal Server Error.

1 Like

.htaccess code is

RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.sourcesofincome.net/$1 [R,L]

Could you please try our recommended .htaccess snippet instead?

Hard coding a website URL is not necessary and assuming HTTPS from the port number is a bit naive.

1 Like

i used your recommended code too, but error still the same

RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} =http
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

To check whether that error because of that .htaccess file or not, try to rename/remove that .htaccess file.
Then visit your site.

If still error, then the error isn’t because of it.

I just want redirect automaticaly from http to https.

Yes, but to help you debug, rename your .htaccess to testfile or something, so we can see if it really is the htaccess

2 Likes

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.