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 am trying to use .htaccess to make one page on my site redirect to it's https counterpart. The checkout.php page lives in the root / html folder of the site. ( /checkout.php ). I tried using this : (which i found online somewhere). I put it up and got an internal server error.

RewriteEngine On
RewriteCond %{HTTPS} on
RewriteCond %{REQUEST_URI} !checkout.php
RewriteRule ^(.*)$ http://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

The idea is, if a customer is on the checkout.php page then redirect to https... if they aren't, redirect to http. Any help would be awesome.

share|improve this question

Here the Rewrite code I use to redirect plain http wordpress admin page access to https. You can customize it to your needs.

     RewriteEngine On
     RewriteCond %{SERVER_PORT} !^443$
     RewriteRule ^wp-admin [R=301,L]
share|improve this answer
I am still having a bit of trouble : the line RewriteRule ^wp-admin [R=301,L] for my implementation would I just change ^wp-admin to ^checkout.php and also the change to the url to the right? I did that and it gave me an internal server error. – xCNPx Feb 15 '13 at 21:37

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.