.htaccess keep redirecting to root url for www

Viewed 32

When accessing http://www.mysite.edu.my/subfolder it keep pointing to https://www.mysite.edu.my/root_subfolder (redirect to root_subfolder is made in index.php, I've tried redirecting via .htaccess but the problem still occurs) instead of going to the subfolder page itself.

When accessing using below url all working fine and pointing to the subfolder page:

  1. http://mysite.edu.my/subfolder (non-https, non-www)
  2. https://mysite.edu.my/subfolder (https, non-www)
  3. https://www.mysite.edu.my/subfolder (https, www)

The only problem is when using:

  1. http://www.mysite.edu.my/subfolder (non-https, www)

My .htaccess is as below.

RewriteEngine on

RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
0 Answers
Related