We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 47400
    • 21 Posts
    Couldn't seem to find anyone else discussing this, so here goes…

    I recently made the switch from Concrete5 to ModX because I wanted more flexibility in what I could do without having to be a php developer. One feature that C5 has that is absent from ModX is a one click activation for friendly URLs.

    I know the first thing you're going to say is that ModX allows you the flexibility to set these things up the way you want. But for someone like me, I rarely need to tweak the way friendly URLs works, most of the time just needing to switch it on with basic defaults.

    Anyone know of any plans to introduce a feature like this, where the CMS handles the URL rewriting without having to edit .htaccess files and pick options in the back end? Or if not, where can I request the feature? It would save people like me time, hassle and cater to those of us that are more front-end developers.

    Not a massive issue but would be really handy!

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

      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Kind of hard to do when so many different web servers have their own way of configuring and rewriting URLs.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 4172
        • 5,888 Posts
        I never had to edit the .htaccess file for common setups.
          -------------------------------

          you can buy me a beer, if you like MIGX

          http://webcmsolutions.de/migx.html

          Thanks!
          • 47400
          • 21 Posts
          Quote from: sottwell at Jul 24, 2014, 09:05 AM
          Kind of hard to do when so many different web servers have their own way of configuring and rewriting URLs.

          In all honesty, this is a subject that I only have a basic understanding of, hence why it would be a good feature for people like me wink

          Concrete5 literally has one button to click and it sorts all URL rewriting for you on pretty much any server set up - even locally on mamp. Not sure how they do it but it would be useful testing friendly URLs when developing locally.


          Quote from: Bruno17 at Jul 24, 2014, 09:16 AM
          I never had to edit the .htaccess file for common setups.

          The standard instructions for setting up friendly URLs (http://rtfm.modx.com/revolution/2.x/administering-your-site/using-friendly-urls) say that you should edit the .htaccess file and then change some options in the manager. I've never been able to find a different way of setting them up, do you have a simpler way?


          The benefits of using ModX over C5 are massive to me which is why I've made the switch, but the friendly URLs set up is definitely a feature that I miss… I think it would be a massive time saver to a lot of people unless there is a simpler way of doing this that I can't find?
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            C5 only provides the "easy" method for Apache web servers and .htaccess. And even that tells you that you might need to edit your .htaccess file. MAMP uses Apache, so that's easy.

            As far as Apache and .htaccess goes, the only time I need to edit it is if I'm running MODX in subdirectories, which I do all the time in my MAMP setup. Other than that, I've never had to mess with it.

            The MODX Cloud hosting environment uses nginx, and it's all set up for friendly URLs. All you have to do is turn it on in the System Settings. Relatively recently they added a feature of allowing you to make some modifications to the rewrite rules.
              Studying MODX in the desert - http://sottwell.com
              Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
              Join the Slack Community - http://modx.org
              • 44580
              • 189 Posts
              Quote from: alanstr84d at Jul 24, 2014, 09:28 AM


              The standard instructions for setting up friendly URLs (http://rtfm.modx.com/revolution/2.x/administering-your-site/using-friendly-urls) say that you should edit the .htaccess file and then change some options in the manager. I've never been able to find a different way of setting them up, do you have a simpler way?

              Not a simpler way, but I found those instructions a bit obscure and incomplete so I documented the process for myself. Hope you find it useful: http://rgissing.com/blog/modx-revo-friendly-urls/
                • 3749
                • 24,544 Posts
                Here's an even simpler method that will work almost all the time:


                1. Rename the ht.access file in the MODX root directory to .htaccess
                2. Go to the System Settings grid in the Manager (System -> System Settings in 2.2, Gear Icon -> System Settings in 2.3).
                3. Type "friendly" (without the quotes) in the "Search by key" box at the upper right of the grid and press enter.
                4. Change "Use Friendly Aliases" to 'Yes'.
                5. Clear the Site Cache

                If you want your URLs to contain the full path to the page, also change "Use Friendly Alias Path" to 'Yes'.
                  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
                  • 47400
                  • 21 Posts
                  Thanks for the replies guys.

                  A couple of you have said that you don't need to edit .htaccess for this to work, you only need to rename it? Am I understanding you correctly? The default .htaccess file doesn't have a domain name in it so unless you edit it, how would it just work?

                  Sorry if I'm being a bit thick, it's just that all the documentation that I've read and even gissirob's guide all show the domain name being edited in .htaccess to get this to work… unless I'm missing something?

                  Unfortunately none of these methods are working for me at the moment but that's likely due to the fact that because I haven't got control of my client's URL yet, I'm developing their new site on a domain reference. I've tried using GasMask to point my hosts file to the correct ip address for the dev site but doesn't seem to like it. I'll just have to wait until I can get control of the domain name…
                    • 28042 ☆ A M B ☆
                    • 24,524 Posts
                    No, it doesn't need the domain name to work. The only time you would need to edit the domain name is if you are using one of the "everything-to-www" or "everything-to-no-www" rules, or if you need to have https as the protocol.
                      Studying MODX in the desert - http://sottwell.com
                      Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                      Join the Slack Community - http://modx.org
                      • 47400
                      • 21 Posts
                      Quote from: sottwell at Jul 25, 2014, 07:39 AM
                      No, it doesn't need the domain name to work. The only time you would need to edit the domain name is if you are using one of the "everything-to-www" or "everything-to-no-www" rules, or if you need to have https as the protocol.

                      Ok that's interesting. I'll have to give that a go when I take control of the domain name and can get it working properly.

                      Maybe the documentation should be updated to reflect that? Everything I've read led me to believe that you had to change the domain name in the .htaccess. As I said earlier in the thread, my knowledge is mainly focused on front end so for something like this I usually follow the documentation to the best of my understanding.

                      You can also simply create your own .htaccess file in any text editor, paste in the following code, save it in the MODX site root, and edit it accordingly:

                      change the DOMAINNAME to your domain name in lowercase.
                      For me: shawnwilkerson
                      change the TLD to the com, net, org, info, whatever you have
                      For me: com