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

Currently the coder has the following line in the .htaccess file:

RewriteRule ^registration$ registration.php

I understand what this means.

However I also want to redirect domain.com/registration to https://domain.com/registration

Anybody know how I could achieve this? I do not want any other pages in the app to go to https://...

Regards, Fiona

share|improve this question

2 Answers 2

up vote 3 down vote accepted

You need to ensure that the traffic is not already coming in via HTTPS before your perform the rewrite otherwise you could end up with an infinite rewrite loop.

Assuming Apache 2.0 and above:

RewriteCond HTTPS off
RewriteRule ^/registration$ https://domain.com/registration.php
share|improve this answer
    
Thanks DaveG. Thats great. –  Fiona Feb 17 '10 at 9:18
    
ok.. so that worked for me. However on successful registration the user I want the user to be transferred to: domain.com/registration/done.php I think because of the jump from https to http - its not finding the page and is just reloading registration.php. Any ideas? (It was working pre messing with .htaccess file) Fiona –  Fiona Feb 17 '10 at 10:40

Use

RewriteRule ^/registration$ https://domain.com/registration.php
share|improve this answer
    
Thanks Dominik. Now it just looks so simple! Thanks again. –  Fiona Feb 17 '10 at 9:18

Your Answer

 
discard

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.