SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: htaccess help

  1. #1
    SitePoint Addict blizzman24's Avatar
    Join Date
    Jul 2004
    Location
    Texas
    Posts
    345
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    htaccess help

    I want to use https just for the login page. How do I make it go back to http after the user has logged in?


    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteRule ^login.php https://www.mysite.com/login.php [R=301,L]

    this htaccess file checks if https is off. if it is, then redirect to the https version of the login(if the user gets to the login page). At least that's what I think it does.

    now after it logs in, it stays in https... how do I make it come out of it?

  2. #2
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,605
    Mentioned
    19 Post(s)
    Tagged
    2 Thread(s)
    blizz,

    {HTTPS} is either on or null so your mod_rewrite should never match (in my signature's tutorial, I recommend using the port).

    Personally, I use a combination of mod_rewrite and PHP checks to ensure secure mode (when required) or just mod_rewrite when secure mode is not required.

    How do you make a visitor return to HTTP from login? By using PHP's header() command and using an absolute link to http://yadda.yadda, of course.

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator


Bookmarks

Posting Permissions

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