A site we are working on siterequires forcing to https and www removal When we make that happen using this .htaccess code

RewriteCond %{HTTP_HOST} ^www\.
RewriteRule ^(.*)$ https://safe.org.nz%{REQUEST_URI} [L,R=301]

With this enabled, and we access this url http://safe.org.nz/admin <= note http://...... It redirects to https://safe.org.nz instead of https://safe.org.nz/admin

Any ideas ? Thanks very much for any tips

  • Something else would seem to be doing that. The directives you posted won't redirect http://safe.org.nz/admin because the hostname does not start www.. If you look at the network traffic you will see a 302 HTTP response code. The directive you posted is a 301. The directives you posted do not "force HTTPS", they simply canonicalise the www subdomain. – MrWhite Jan 3 at 0:25
  • Thanks for your comment @MrWhite We're looking into that. The setup is a bit convoluted – Prema Jan 3 at 6:25

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.