We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 27841
    • 3 Posts
    hi modx people...

    i’m wondering if i can change the assigned id number for urls for different folders and documents.

    if i have a url which is, say, site.com/index.php?id=46, but i’d prefer it to be site.com/index.php?id=2, how do i change the numbers?

    thanks.
      • 7923
      • 4,213 Posts
      You would need to manually change the ID number of the document in database table (site_content), but that can break something if you have other records linked to it (eg. permissions etc.) or references in snippetcalls/snippets.. you could backup the database first and then try to see what happens.


        "He can have a lollipop any time he wants to. That's what it means to be a programmer."
        • 27841
        • 3 Posts
        thanks.

        would i be able to change the numbers in the database to names? i.e. from site.com/index.php?id=46 to site.com/index.php?id=contact or similar?
          • 7923
          • 4,213 Posts
          No, use the FURL feature in MODx to do that. Go to system configuration, friendly url settings and enable it and use the alias fields in documents to write the alias name, e.g. contact.


            "He can have a lollipop any time he wants to. That's what it means to be a programmer."
            • 27841
            • 3 Posts
            ah - the problem with that is that i’m not on a server which can handle friendly urls.

            if i start changing numbers to letters in the database, will stuff still work (after tweaking stuff in the manager)?
              • 727
              • 502 Posts
              If you manage to get something like index.php?id=contact to work, I think you will still have problems with search engine indexing. Plus you will have to redo all your modifications to the core each time you upgrade MODx. If you really want to have some user friendly links to pages you could always using a PHP file with a redirect. For example:

              contact.php:

              <?php
              header("Location: index.php?id=46");
              ?>


              But it is much better to move to a server that supports friendly URLs.

              Andy
                • 22303 MODX Staff
                • 10,725 Posts
                First, FURLs uses ?q=alias and there is no issue with using that in SEO. And second, the mod_rewrite functionality is optional, so you can certainly use them without having mod_rewrite support.