We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25357
    • 92 Posts
    - Revo, all versions
    - various permutations of Linux
    - always using furls, and they function properly

    (This is an informational discussion, not a problem to be solved.)

    I encounter this time and time again. For various reasons, I'll often have to create a custom form snippet and use the post method for the data. The "parent resource" will always be the document in which it's used, e.g. if the URL is /widgets it will post to /widgets as the form action.

    <form method=post" action="/widgets">


    Invariably, this always loses the post data and just "reloads" the page. After much frustration on the first few projects, I (think I) figured out why it's happening

    RewriteRule ^([^.]+)$ index.php?q=$1 [L,QSA]

    ... which passes only a get query string back to modX.*

    But . . . if I do this . . . .

    <form method=post" action="/widgets/">


    (Note the trailing slash) it posts properly to the snippet.

    Does anyone have any idea why that would be?

    * You may not recognize that rewrite rule, which does not require the double-entire file system search with ! -d or ! -f, but I've reverted it to the less efficient rule in debugging this. The outcome is the same. Topic for a different discussion - unless you think "if it doesn't have a dot rewrite" would have something to do with it.

    [ed. note: rocknbil last edited this post 12 years, 5 months ago.]