Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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.