We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3005
    • 1 Posts
    Hello,

    I am wondering is there a recommended way of configuring or working with MODx that would enable the ability to not use the .php extension on page requests?

    Thank you
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      I believe that you are referring to SEO-Friendly URLs. MODx does have the ability to do this. It requires some kind of URL rewrite support; this differs depending on the web server being used. For the most common Apache environment, the included ht.access file does the job after being re-named or copied to .htaccess to enable the Apache URL rewrite module and specify the rewrite rules to be used for MODx.

      Then in the Manager, in Tools->Configuration, go to the Friendly URLs tab and turn it on. Each resource can be given an "alias" to be used for the rewritten URL (contact.html), or the configuration can be set to use the page title (contact-us.html), or MODx will just use the resource ID (42.html). When you turn on Friendly URLs in the configuration, you’ll be given a number of configuration options for them, including the suffix to use (.html is the default).
        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
        • 29089
        • 13 Posts
        If you want to get rid of extensions all-together (I find its nicer looking and is better for SEO), then mark the resource as a container in the Page Settings tab when editing the resource.

        This will display your links as http://domain.com/resource-alias/

        However, this does require that friendly URL’s are activated, which requires mod_rewrite on apache.