We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 38689
    • 14 Posts
    The Friendly URL implementation seems to affect the passing of URL parameters in Evo. I have a calendar script that works perfectly in a non-MODx file, epc.php. When I click the next month link, I get:
    epc.php?mo=12&yr=2012, then
    epc.php?mo=1&yr=2013, etc. As expected.

    I put the same script in a MODx resource, events-test.php, on a site with Friendly URLs. When I click the next month link, I get:
    events-test.php?q=events-test.php&mo=12&yr=2012
    then (I added spaces to prevent forum from converting & chars)
    events-test.php?q=events-test.php & amp;amp;q=events-test.php & amp;amp;mo=12 & amp;amp;yr=2012 & mo=1 & yr=2013
    ,
    and after that it gets really messy!

    I believe it is the htaccess that is adding the q parameter - this line:
    RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

    In the MODx configuration, Site tab, I have XHTML URLs set to Yes. Apparently this "Replaces ampersand (& ) characters in urls that are generated by MODx with the validating & htmlentity." This is probably what is changing & to "& amp ; amp ;" (spaces inserted again).

    Does anyone have any suggestions for cleaning up these generated URLs? [ed. note: pogopogo last edited this post 13 years, 11 months ago.]
      • 30023
      • 172 Posts
      You haven't detailed how you have integrated the calendar script with your MODx template, but I'd suggest modifying the calender script to ignore the 'q' parameter when generating its URLs.

      Alternatively you need a wrapper snippet that will strip the 'q' parameter, which could be a little messy, but will allow you to upgrade the calendar script more easily.

      -- Tim.
        • 38689
        • 14 Posts
        This is a purchased script and the source is not available, unfortunately (Easy PHP Calendar).
        Here's what I did to clean up the URL:
        I created a snippet to check the query string. If there are two or more occurrences of 'q=' then I clean up the URL. I strip the q= parameter and if mo and yr are specified, I add them (just once). Then I redirect the page. It works.