I am using HTTPS and WWW only rules in Drupal 7's .htaccess like:

RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

# ensure https
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

It works nicely, but now I discovered there are some link from old website in form like www.oldwebsite.com/url-path where /url-path is redirected to our website in form www.newwebsite.com/url-path - but now because of WWW and HTTPS only, it got stripped of /url-path and is redirected to index only.

How can I fix that? So the old website redirects are not lost?

It works when I remove HTTPS WWW only htaccess rules.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.