Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-28030

Add config.php settings to allow plugins to rewrite output moodle_urls (eg clean / semantic urls)

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      Install the clean_urls local plugin available here which uses these two hooks:

      https://github.com/brendanheywood/moodle-local_cleanurls

      Follow the install instructions:

      https://github.com/brendanheywood/moodle-local_cleanurls#installation

      Note this issue is purely just confirming that the two hooks are working, not the details of the cleanurls plugin. To test the 'url_rewrite' hook is working you should see that the urls are different eg urls like this:

      /course/SHORTCODE/forum/1-forum-name

      To test if the 'pre_head_content' hook is working view the source and you should see a base href link like this:

      <base href='http://moodle.blah.io/mod/forum/view.php?id=8'>

      Show
      Install the clean_urls local plugin available here which uses these two hooks: https://github.com/brendanheywood/moodle-local_cleanurls Follow the install instructions: https://github.com/brendanheywood/moodle-local_cleanurls#installation Note this issue is purely just confirming that the two hooks are working, not the details of the cleanurls plugin. To test the 'url_rewrite' hook is working you should see that the urls are different eg urls like this: /course/SHORTCODE/forum/1-forum-name To test if the 'pre_head_content' hook is working view the source and you should see a base href link like this: <base href='http://moodle.blah.io/mod/forum/view.php?id=8'>
    • Affected Branches:
      MOODLE_20_STABLE, MOODLE_31_STABLE
    • Fixed Branches:
      MOODLE_31_STABLE
    • Pull Master Branch:
      MDL-28030-cleanurls

      Description

      Clean URLs (a.k.a. Friendly URLs) are URLs that are rewritten to look like a directory structure rather than a PHP query. For example:

      Messy URL: http://example.com/course/view.php?id=1
      Clean URL: http://example.com/course/1

      All other modern Content Management Systems I've encountered [Drupal, WordPress, etc.] have some implementation of Clean URLs. This is because they serve a variety of crucial functions: easy to remember web addresses; search engine optimization; makes the site look more professional; etc. Ideally, site admins should be able to customize the clean URL for at least some kinds of content [i.e. Pages].

      This issue has been discussed in the forums for years. When will this feature be implemented?

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              brendanheywood Brendan Heywood
              Reporter:
              treesong Treesong
              Peer reviewer:
              Adrian Greeve
              Integrator:
              Dan Poltawski
              Tester:
              Andrew Nicols
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Bas Brands
              Votes:
              42 Vote for this issue
              Watchers:
              38 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                23/May/16