I am working on this site which which redirects to https except of when someone writes a url starting with www and opens a page except of homepage. For example,

www.demacmedia.com/work

Here is the code I am using in htacess file to redirect,

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
RewriteCond %{HTTPS} off
# Rewrite to HTTPS:
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>

# END WordPress

Read more here: Site not redirecting to https even after having rewrite condition


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: