We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 9255
    • 41 Posts
    I need a brief rundown on how to get friendly urls to work. I want to have the urls set up like www.xxxxx.com/pagename.php (or better yet without the .php but I think it has to have an extension in modx). I am working on my first modx website so please bear with me as I am learning. I have followed a tutorial on friendly urls online but everytime I tried to navigate to a page I got a page not found error. Any help is much appreciated.
    • 1. Rename ht.access to .htaccess in both your MODx installation directory and in the manager directory. If your MODx installation is in a subdirectory of your web space root, edit the .htaccess file and add the subdirectory to the RewriteBase line; for example:
      RewriteBase /modx


      2. Turn on Friendly URLs in the Configuration. You can specify any prefixes and suffixes you want here; by default there is no prefix and the suffix is .html; you can have them both empty if you don’t want any at all. You can also specify "friendly url paths", which will make a link indicating the path to a given document (yourdomain.com/news/latest_news/newsarticle1).

      3. Give all of your documents URL-legal aliases. If you don’t want to do this, you can either accept the document ID as the link (mydomain.com/42) or in the Configuration tell MODx to generate a proper link out of the document’s page title.

      MODx will generate the proper URL for a document using all of these settings.

      If your site is served by IIS or some other web server that does not use .htaccess files, you’ll have to determine how you can do URL rewriting with the server you’re using.
        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
        • 9255
        • 41 Posts
        Quote from: sottwell at Aug 06, 2009, 03:49 PM

        1. Rename ht.access to .htaccess in both your MODx installation directory and in the manager directory. If your MODx installation is in a subdirectory of your web space root, edit the .htaccess file and add the subdirectory to the RewriteBase line; for example:
        RewriteBase /modx


        2. Turn on Friendly URLs in the Configuration. You can specify any prefixes and suffixes you want here; by default there is no prefix and the suffix is .html; you can have them both empty if you don’t want any at all. You can also specify "friendly url paths", which will make a link indicating the path to a given document (yourdomain.com/news/latest_news/newsarticle1).

        3. Give all of your documents URL-legal aliases. If you don’t want to do this, you can either accept the document ID as the link (mydomain.com/42) or in the Configuration tell MODx to generate a proper link out of the document’s page title.

        MODx will generate the proper URL for a document using all of these settings.

        If your site is served by IIS or some other web server that does not use .htaccess files, you’ll have to determine how you can do URL rewriting with the server you’re using.

        Thank you for that rundown, right now in a testing environment I am using iis but in production I will not be, this may be a production environment change. Thanks
        • It can be done in IIS; there was a very interesting post on it just yesterday... if only I could find it again!

          Ah, here it is http://modxcms.com/forums/index.php/topic,26232.msg231605.html#msg231605
            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