Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I'm struggling writing a rewrite rule for a drupal login page which needs to accessed under https.

RewriteRule ^/?(/user) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

so baiscally i need to redirect /user to https:// (base url) /user

Can anyone provide a pointer as to how to do this please?

share|improve this question

2 Answers 2

This should do the trick:

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule /(user|admin) https://%{HTTP_HOST}%{REQUEST_URI} [R]
share|improve this answer

How about using the Secure Login module?

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.