1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Redirecting specific pages from http to https and reverse

Discussion in 'Apache' started by PanzerKunst, Jul 19, 2010.

  1. #1
    Hello all,

    I'm trying to redirect 3 pages to from http to https, and all others from https to http. I have these 2 paragraphs in my .htaccess file:

    RewriteCond %{HTTPS} off
    RewriteCond %{REQUEST_URI} ^/cart/checkout [OR]
    RewriteCond %{REQUEST_URI} ^/cart/checkout/review [OR]
    RewriteCond %{REQUEST_URI} ^/cart/checkout/complete
    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]

    RewriteCond %{HTTPS} on
    RewriteCond %{REQUEST_URI} !^/cart/checkout
    RewriteCond %{REQUEST_URI} !^/cart/checkout/review
    RewriteCond %{REQUEST_URI} !^/cart/checkout/complete
    RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [R,L]


    When only one of them is there, the corresponding redirection works. But whenever both paragraphs are written, there is an issue (I'm not connected to the server right now, I cannot give more details sorry)

    I'd really appreciate help on this, I'm really confused right now and can't really have a clear view on what I'm doing...
     
    PanzerKunst, Jul 19, 2010 IP