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.

Rewrite from https to http? HELP!

Discussion in 'HTML & Website Design' started by martinos, Mar 16, 2010.

  1. #1
    Hello

    I have met a problem with the rewrite of my .Htaccess.

    Now i have my entire site to be rewrite'ed from http://www.mysite.com to https://secure.mysite.com
    and it's encoded in my .htaccess:

     Options +FollowSymlinks
    RewriteEngine on
    RewriteCond %{HTTP_HOST} !^secure.mysite.com [NC]
    RewriteRule ^(.*)$ https://secure.mysite.com/$1 [L,R=301]  [/ code]
    
    In this way, every single page redirected to my secure server at https://secure.mysite.com
    It works very well and so it shall remain.
    
    
    but there is a single page, which I do not want to become rewrite'ed,
    eg I do not want to http://www.mysite.com/page1.php  be rewriteed to https://secure.mysite.com/page1.php
    it is the only urI do not want it to rewrite,
    
    what should I add more to the code I have currently?
    
    I hope you could help .. :)
    ps. I am not an expert so I may like to write what to add to my code: wink:
    
    Sincerely, Martin
    Code (markup):

     
    martinos, Mar 16, 2010 IP
  2. Bagi Zoltán

    Bagi Zoltán Well-Known Member

    Messages:
    364
    Likes Received:
    23
    Best Answers:
    0
    Trophy Points:
    110
    #2
    Options +FollowSymlinks
    RewriteEngine on
    RewriteCond %{REQUEST_URI} !^page1.php$ 
    RewriteCond %{HTTP_HOST} !^secure.mysite.com [NC]
    RewriteRule ^(.*)$ https://secure.mysite.com/$1 [L,R=301] 
    Code (markup):
     
    Bagi Zoltán, Mar 16, 2010 IP
  3. martinos

    martinos Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    thanks for the reply Bagi Zoltan
    but it dont work? : /

     Options + FollowSymlinks
    RewriteEngine
    RewriteCond% (HTTP_HOST)! ^ Secure.mysite.com [NC]
    RewriteRule ^(.*)$ https: / / secure.mysite.com / $ 1 [L, R = 301] [/ code]
    
    the code I wrote in my first post: redirect Every page on my website to https://secure.mysite.com .. and it is very good but, I want to rewrite the http://mysite.com/page1.php  if you look with my code in the first of this message to page1.php will look like https://secure.mysite.com/page1.php and I dont want it rewrite page1.php, maye you have another solution.
    
    thanks:)
    Code (markup):
     
    martinos, Mar 16, 2010 IP
  4. Bagi Zoltán

    Bagi Zoltán Well-Known Member

    Messages:
    364
    Likes Received:
    23
    Best Answers:
    0
    Trophy Points:
    110
    #4
    Please try this

    Options +FollowSymlinks
    RewriteEngine on
    RewriteCond %{REQUEST_URI} !^/page1\.php$ 
    RewriteCond %{HTTP_HOST} !^secure.mysite.com [NC]
    RewriteRule ^(.*)$ https://secure.mysite.com/$1 [L,R=301]
    Code (markup):
     
    Bagi Zoltán, Mar 16, 2010 IP
  5. martinos

    martinos Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    it did not help either :S
     
    martinos, Mar 16, 2010 IP