We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 29597 ☆ A M B ☆
    • 350 Posts
    I am creating a extra called MODX Start, a core extra to serve as the base for my themes.
    MODX Start will do the following on install:

    • create 'MODX Start' Category
    • add 'modx_start' Namespace
    • setup 'modx_start' default Lexicon topic
    • add a demo translation in the 'modx_start' Lexicons
    • create Homepage and Basic page templates
    • create site settings: 'error_page', 'default_template', 'site_unavailable_page', 'unauthorized_page'
    • create settings for 'web' context: 'error_page', 'default_template', 'site_unavailable_page', 'unauthorized_page' (this makes creating a multiligual site later easy)
    • create resources and set correct settings and template: 'Error page', 'Site offline', 'Not allowed', 'sitemap'

    A other steps I normally need to do for every project (and these I would like to do with MODX Start) are:

    • set friendly_urls to yes
    • set use_alias_path to yes
    • add a .htaccess (copy of ht.access)

    Can't I just include this in my extra?
    Why is a .htaccess and Friendly URL's not added by default with MODX and is it a bad idea to try to set Friendly URLS's in a extra?

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

      MODX Ambassador (NL) | Responsive web design specialist, developer & speaker
      DESIGNfromWITHIN, MPThemes and Any Screen Size
      Follow me on Twitter | Read my blog | My code on GitHub
    • discuss.answer
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      I can think of two reasons just off the top of my head.

      1. Not everybody is running Apache servers, and setting Friendly URLs without having the appropriate server rewrite rules causes Bad Things to happen.
      2. Some hosting providers use the .htaccess file to set certain required features, like the location of the php.ini for for the desired version of PHP. Installing your own .htaccess file will overwrite that, again causing Bad Things to happen.

      The reason it's not part of a default MODX installation is that whether or not the site even uses an .htaccess file or what Apache configuration is done in any such .htaccess file is highly variable, depending on the hosting server's configuration.
        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
        • 3749
        • 24,544 Posts
        You could provide a form that will appear during the install that has checkboxes for those options and explains when, and when not, to select them.

        You can also test for Apache with isset('DOCUMENT_ROOT'), since I think Apache is the only platform that sets it. [ed. note: BobRay last edited this post 10 years, 9 months ago.]
          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
          • 51580
          • 1 Posts
          I am also try this way to seo friendly url