We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 20025
    • 6 Posts
    Hi!

    I have some page which calls snippet, that generates some content regarding to parameter.
    It works if url is like this: mysite.com/some_page/?param=param_value

    I need that url should be like: mysite.com/some_page/param_value/

    How it can be done with modx?

    i can’t find the answer in forum search sad

    p.s. sorry for my poor english, it’s not my native language.
      UNSIGNED, NOT NULL
      • 21191
      • 236 Posts
      My guess would be to dig into htaccess and learn how it’s being done naively. I’m sure it’s possible.
        ~Shawn Himmelberger
        Check out my MODx Development and MODx Design Company - Himmelberger Design
        • 3749
        • 24,544 Posts
        I’m not sure I understand your question. It sounds like your snippet is creating a URL to a non-MODx document.

        If that’s the case, the snippet can make the URL itself and use this to send the user there (or put a link on the current page):

        $modx->sendRedirect($url);


        If it’s a MODx document on the site, the snippet can use this (if you know the id of the document):

        $url = $modx->makeURL($id);
        $modx->sendRedirect->($url);


        If that doesn’t make sense, try posting the code from your snippet here.
          Did I help you? Buy me a beer
          Get my Book: MODX:The Official Guide
          MODX info for everyone: http://bobsguides.com/modx.html
          My MODX Extras
          Bob's Guides is now hosted at A2 MODX Hosting
          • 22303 MODX Staff
          • 10,725 Posts
          Using a plugin with OnPageNotFound to create custom routing for URLs like this is very easy in MODx. You can simply read the REQUEST_URI, break it down into segments, use some segments to set $_GET variables and then route requests to a specific MODx Resource using $modx->sendForward($idOfResource). The page will be rendered at the URI requested by the client and will have access to the GET variables as if they were passed in the QUERY_STRING.