Results 1 to 7 of 7
  1. #1
    Join Date
    Dec 2005
    Posts
    549

    how to force redirect https to http

    with htaccess files.

    so if someone enter
    https://www.domain.com

    i want to redirect him to http://www.domain.com

  2. #2
    Join Date
    Mar 2006
    Posts
    965
    PHP Code:
    if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') {
    your condition here ...


  3. #3
    Join Date
    Jan 2003
    Location
    Seattle
    Posts
    255
    Redirect / http://yourdomain.com/

    Would probably do it.

    Iggy
    Evolve Networks - Hosting, Design & Development for Business and Individuals
    EosC - Evolve Networks Loaded Edition of osCommerce

  4. #4
    Join Date
    Dec 2002
    Location
    chennai , tamil nadu , IN
    Posts
    1,423
    At present if they type https://www.domain.com where does it go ?
    Chris, Developer/Programmer,
    Php laravel developers,
    Ruby on Rails developers,
    www.chrisranjana.com

  5. #5
    Join Date
    Dec 2005
    Posts
    549

  6. #6
    Join Date
    Feb 2005
    Location
    Australia
    Posts
    5,842
    Are you trying to do this in order to prevent security warnings? If so it won't work - the warnings will be generated when the ssl connection is established, before the redirect can take effect.

    But if you still want to try, this should do it:
    Code:
    RewriteCond %{HTTP_HOST} ^www\.domain\.com$
    RewriteCond %{SERVER_PORT} ^443$
    RewriteRule (.*) http://www.domain.com/$1 [R=301,L]
    Chris

    "Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them." - Laurence J. Peter

  7. #7
    You can also try the 302 - permanent redirection.
    If it is suitable in your case.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •