On March 26, 2019 we launched new MODX Forums. Please join us at the new MODX Community Forums.
Subscribe: RSS
  • Hi!

    I have a page (my-page.html) where I have several content created by a personal database. So, I want to access to each content individually. The easy way is to put variable into the URL like this:
    my-page.html?page=my-second-content
    And I can get the variable with a simple $_GET
    But it's not a friendly URL solution. I want this:
    my-page/my-second-content.html
    However, this URL display the homepage of course.
    I think that the solution is to change the .htaccess file, but I'm not sure and, most important, I don't know how (properply). Or, maybe you have another way.

    Someone can help me? Please.

    Thanks.

    This question has been answered by neoziox. See the first response.

    • can be done with a plugin at OnPageNotFound, for example the customRequest - Extra:
      https://modx.com/extras/package/customrequest
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
      • But, it’s a Revo Extra :-(
        • sorry, didn't see it was for EVO. Then I don't know, if there is a OnPageNotFound - Event, but I think it should.
            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!
          • discuss.answer
            I found a solution with .htaccess

            # Personal request
            RewriteRule my-page/(.*)$ my-page.html?filter=$1 [L,N]
            
            # For Friendly URLs
            RewriteCond %{REQUEST_FILENAME} !-f
            RewriteCond %{REQUEST_FILENAME} !-d
            RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]