1

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

3

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
  • 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
2

Use

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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