We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 18884
    • 2 Posts
    Here is an excerpt from my .htaccess file:

    # The Friendly URLs part
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ mymodx/index.php?q=$1 [L,QSA]



    this allows mymodx/contact to work.
    This didn’t work when i installed modx, i had to hack that myself.

    I want to bring query strings into the mix while still using flat urls. For example, I want mymodx/contact/usa to load like i had typed contact?country=usa

    My concept was this:

    # The Friendly URLs part
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^contact(.*)$ mymodx/contact?country=$1 [L,QSA]

    # The Friendly URLs part
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ mymodx/index.php?q=$1 [L,QSA]

    So all pages load normally except the contact page when given a query string. Unfortunately this ain’t working. What am I doing wrong?