cancel
Showing results for 
Search instead for 
Did you mean: 
XGeny
Novice

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!

2 REPLIES
Highlighted
manojkumarcdo
Journeyperson

Re: HTTP Does Not Force To HTTPS.

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!.

 

 

XGeny
Novice

Re: HTTP Does Not Force To HTTPS.

It doesn't work @manojkumarcdo.