We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 577
    • 132 Posts
    Maybe I am misunderstanding what the $_REQUEST[’q’] value is truly suppose to represent. In most cases it appears to be equal to $_SERVER[’REQUEST_URI’] and therefore I have treated it as so. However I just ran into a case were this is not the case. Maybe this is a bug or maybe I have just been using it wrong all this time.

    URL: http://modx.secondtimearoundwatchco.com/watches-for-sale/brock+%26+co./triple+date/7271
    URL: http://modx.secondtimearoundwatchco.com/watches-for-sale/brock%20%26%20co./triple%20date/7271

    $_REQUEST[’q’] = "/watches-for-sale/brock"

    $_SERVER[’REQUEST_URI’] = "/watches-for-sale/brock%20%26%20co./triple%20date/7271"

    Under the conditions I am experiencing its the "&" represented as %26 that is breaking this $_REQUEST[’q’].

    In fact the full REQUEST array becomes.

    array(2) { ["q"]=> string(23) "watches-for-sale/brock " ["co_/triple_date/7271"]=> string(0) "" } 
    


    So I guess even if ’q’ is not intended to be equal to REQUEST_URI we still have an issue here. I see no value in having the REQUEST array be as noted above.

    Note: "brock%20%26%20co./triple%20date/7271" is not a resource path and thus is not being held to the same requirements of a alias naming. 
    The path to "watches-for-sale" is a container for which all requests are routed into when they start with "watches-for-sale". 
    Much like it is with VisionCart and the "shop" container.
    


    Curious & Confused

    Adam
      "One of these days I will get around to my own website... Its only been about 12 years... maybe tomorrow smiley"
      • 22303 MODX Staff
      • 10,725 Posts
      First, if you look under the Area entitled Gateway in System Settings, you will see a setting with the key request_param_alias with a value of q. This defines the request parameter sent to the request_controller, defined as index.php, which identifies the friendly url of a Resource being requested. This is not the same as REQUEST_URI in all cases, especially if you are using MODX in a subdirectory of the web root. So the value of $_REQUEST[$modx->getOption(’request_param_alias’)] be the relative URI which identifies the Resource uniquely (at least within a Context).
        • 577
        • 132 Posts
        Thank you for the clarification on this.
          "One of these days I will get around to my own website... Its only been about 12 years... maybe tomorrow smiley"