Results 1 to 4 of 4

Thread: Htaccess & QSA flag

  1. #1

    Join Date
    Sep 2002
    Location
    Auckland
    Posts
    1,356
    Rep Power
    17

    Htaccess & QSA flag

    Hello.

    I am using a short URL, however i want to pass along some variables as well. using google, I have found that the QSA flag on htaccess allows me to do this.

    i have found some old powweb forum posts that say this -however when i try to add this to my htaccess, I get an internal server error.

    working code: (NC = case insensitive).

    Code:
     RewriteRule ^login$ /index.php?login=yes [NC]
    This works, but if i try QSA or NC, QSA - i get errors...

    Code:
     RewriteRule ^login$ /index.php?login=yes [NC, QSA]
    or

    Code:
     RewriteRule ^login$ /index.php?login=yes [QSA]

    can anyone advise the current / propper way to go to the login screen. with or without extra variables added to the URL.

  2. #2

    Join Date
    Sep 2002
    Location
    Auckland
    Posts
    1,356
    Rep Power
    17
    Now my code woks (sort of)

    Code:
    RewriteRule ^login$ /index.php?login=yes [QSA,NC]
    after a few hours of trying, my code Works (NO ERRORS)...

    thats the good thing. why didnt it work (no errors) before ?

    The bad part is - i am getting the 'login' value in my PHP script (as its specified in the htaccess) , however i am NOT getting the email or password variables sent to my php script.

    $_GET shows :-

    Code:
    array(1) {
      ["login"]=>
      string(3) "yes"
    }
    does anyone know how to get

    http://domain.com/login?email=email@address.com passed to the script - using a short URL ?

    EDIT: login will be set - as the URL, but the email/password will not be in a set format

  3. #3

    Join Date
    Sep 2002
    Location
    Auckland
    Posts
    1,356
    Rep Power
    17
    Stupid error. Stupid error (THUMPS HEAD ON WALL),

    been trying to debug htaccess etc for almost 2 days now - I was trying $_GET, but my form sends as POST.

    Stupid error. Stupid error (THUMPS HEAD ON WALL),

  4. #4

    Join Date
    Sep 2002
    Location
    Auckland
    Posts
    1,356
    Rep Power
    17
    AHHh I thought i fixed it - but its still not going..

    If i use POST - i get all the variables in my PHP - but if I use $_GET - nothing appears. the only $_GET variable i do see is the login value.

    (same htaccess as above)

    Code:
    $GLOBALS["log"]="START INDEX.PHP\n";
    
    ob_start();
    var_dump($_GET);
    $GLOBALS["log"].="\n\n\n\n\n\n\n---------------\n1a - GET\n";
    $GLOBALS["log"].= ob_get_clean();
    ob_start();
    var_dump($_POST);
    $GLOBALS["log"].="\n---------------\n1b - POST\n";
    $GLOBALS["log"].= ob_get_clean();
    ob_start();
    var_dump($_REQUEST);
    $GLOBALS["log"].="\n---------------\n1c - REQUEST\n";
    $GLOBALS["log"].= ob_get_clean();
    $GLOBALS["log"].="\n---------------\n\n";
    code i'm trying is :-

    http://sub.domain.com/login?action=l...l=my@email.com

    EDIT - I send the code via email to myself & use the URL - so i need to use GET.

Posting Permissions

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