SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Wizard DoubleDee's Avatar
    Join Date
    Aug 2010
    Location
    Arizona
    Posts
    3,786
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    What does // mean?

    On my laptop, my Home Page is...

    local.debbie


    If I type this...

    local.debbie/

    ...the URL changes back to...

    local.debbie


    But if I type in this...

    local.debbie//

    ...then the URL remains as...

    local.debbie//


    What does all of that mean??


    Debbie

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

    // is the "marker" which separates the protocol from the domain, i.e., http://. Your example, however, is specifying a null directory name which must surely be indeterminate by every http daemon.

    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

  3. #3
    SitePoint Wizard DoubleDee's Avatar
    Join Date
    Aug 2010
    Location
    Arizona
    Posts
    3,786
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by dklynn View Post
    DD,

    // is the "marker" which separates the protocol from the domain, i.e., http://. Your example, however, is specifying a null directory name which must surely be indeterminate by every http daemon.

    Regards,

    DK
    (Sorry for the late response - been a hellish week!)

    The context of my question is this...

    I have the following mod_rewrite...

    Code:
    #PRETTY:		finance/
    #UGLY:			articles/index.php?section=finance
    
    #Rewrite only if the request is not pointing to a real file (e.g. add_comment.php, index.php).
    RewriteCond %{REQUEST_FILENAME} !-f
    
    #Match any kind of Section.  PHP will decide if it's valid or not.
    RewriteRule (.+)/$ articles/index.php?section=$1 [L]
    And then in my Article index.php script, I have this data validation code...

    PHP Code:
        if (isset($_GET['section']) && $_GET['section']){
            
    // Section found in URL.

        
    }else{
            
    // Section Not found in URL.
            
    $_SESSION['resultsCode'] = 'ARTICLE_INDEX_NO_QUERY_STRING_2422';

            
    // Set Error Source.
            
    $_SESSION['errorPage'] = $_SERVER['SCRIPT_NAME'];

            
    // Redirect to Display Outcome.
            
    header("Location: " BASE_URL "/account/results.php");

            
    // End script.
            
    exit();

        }
    //End of ATTEMPT TO RETRIEVE ARTICLES 

    I was expecting that if someone typed in...

    local.debbie//

    or

    http://local.debbie//

    ...that my PHP code would treat that as a Null Section and my error-handling code in the ELSE branch of my PHP would fire?!

    Apparently my mod_rewrite and PHP don't treat it that way?!

    More so, do I really care?

    I am just trying to make sure my mod_rewrite and PHP are ROCK-SOLID and handle really any scenario/combination where a hacker is screwing with either my "Pretty URL" or the "Ugly URL"...

    Thanks,


    Debbie


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
  •