Basically I need to redirect this page


I tried adding a redirect rule to the .htaccess file in /var/www/html/ but that didn't work. From what I know ?q=user is more of an argument then a page. How can I achieve this?

Any help would be greatly appreciated.

2 Answers 2


You might want to have a look a the Secure Pages module, which is:

A small process which will redirect the required pages to a SSL version of the page.

You can easily set up the user/login path as an SSL-required page, and the redirect will be handled for you.

If you want to do it manually, a rule like this in .htaccess would probably work:

RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^user$ https://%{SERVER_NAME}/user [R=301,L]

That would need to go above Drupal's main rewrite rule for index.php.

It's worth bearing in mind you'll need to do this for the user/login path as well as that can be accessed directly.

  • Is there no other way to do a simple redirect? Plus I only need this one page to be SSL.
    – Flo
    Commented Jun 6, 2012 at 18:15
  • I've added an example rewrite rule, I haven't tested it but it should do the trick
    – Clive
    Commented Jun 6, 2012 at 18:22
  • I added that my .htaccess file and nothing changed. When I go to www.web.ca/?q=user there is no redirect.
    – Flo
    Commented Jun 6, 2012 at 18:30
  • It'll work if you've got clean urls turned on and you go to www.web.ca/user. If you're not using clean urls I can only really advise using the secure pages module; parsing a query string in .htaccess won't be a lot of fun
    – Clive
    Commented Jun 6, 2012 at 18:32
  • Question: If I enable clean URLs do I need to change all the internal links on the website? You know? References and such?
    – Flo
    Commented Jun 6, 2012 at 18:34

You can achieve this using Rules and make a rule that when going to that page to redirect the user to the https: page.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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