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.

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
add comment

1 Answer

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 https://www.example.com/wp-admin [R=301,L]
share|improve this answer
    
I am still having a bit of trouble : the line RewriteRule ^wp-admin example.com/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
add comment

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.