cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Go to solution
New

HTTP Does Not Force To HTTPS.

Hey,
I just can't fix this problem. I'm trying to force HTTP to HTTPS but it won't work.

1. I want the entire website to force HTTPS.
2. I want the user to redirect to https://mywebsite.net/home.

This is the code I use:

RewriteEngine on

RewriteCond %{HTTP_HOST} ^mywebsite\.net$ [OR]
RewriteCond %{HTTP_HOST} ^www\.mywebsite\.net$
RewriteRule ^/?$ "http\:\/\/mywebsite\.net\/home" [R=301,L]

I've also tried this code:

RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^ %{REQUEST_URI}.php [L]    

Some help would be awesome, thanks!

1 ACCEPTED SOLUTION

I had the same problem. Despite having changed the .htaccess file of my root on cPanel using the code suggested by godaddy the website loaded either http or https depending on the URL.  I solved the problem with the wp plugin mentioned https://wordpress.org/plugins/https-redirection/ 

Now the website is forced to load as https! yeah, thanks manojkumarcdo

View solution in original post

4 REPLIES 4
Helper IV

Hi @XGeny

 

Try this code

# BEGIN HTTPS Redirection Plugin
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>
# END HTTPS Redirection Plugin

 

For WordPress:
https://wordpress.org/plugins/https-redirection/

 

If you find above code is helpful, give me a kudos!.

 

 

It doesn't work @manojkumarcdo.

it worked for me, thank you.

 

I had the same problem. Despite having changed the .htaccess file of my root on cPanel using the code suggested by godaddy the website loaded either http or https depending on the URL.  I solved the problem with the wp plugin mentioned https://wordpress.org/plugins/https-redirection/ 

Now the website is forced to load as https! yeah, thanks manojkumarcdo

View solution in original post