Jump to:

23545 Posts in 19310 Topics by 2888 members

General Questions

SilverStripe Forums » General Questions » How to set a custom URL route to lowest priority?

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 438 Views
  • sonet
    Avatar
    Community Member
    33 Posts

    How to set a custom URL route to lowest priority? Link to this post

    I am trying to implement clean urls with an variable at the top level (without having a controller action in the URL)
    ex. instead of http://domain.com/cont_action/MyVar having just http://domain.com/MyVar.

    The route below works, but it triggers before everything else. How can I specify my custom route to be the last one that is being checked (lowest priority even after the SiteTree)?

    ---
    Name: approutes
    After:
    - 'framework/routes#rootroutes'
    - 'framework/routes#coreroutes'
    - 'framework/routes#modelascontrollerroutes'
    ---
    Director:
    rules:
    '$MyVar': 'AppController'

  • sonet
    Avatar
    Community Member
    33 Posts

    Re: How to set a custom URL route to lowest priority? Link to this post

    Is a custom handleRequest() override my only option? Anyone?

    438 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.