Customize route '/' from plugin

  • So I want to do this:

    1. If someone opens, then he will be redirected to the forum
    2. If someone opens then he will be redirected to my custom lol.html page

    I'm aware that I can create a custom route from my plugin, but this is not what I want.

    I'm currently using the following hooks:

    "hooks": [
            "hook": "static:app.load",
            "method": "init"
            "hook": "",
            "method": "postSaved"
            "hook": "filter:post.create",
            "method": "postCreated"
            "hook": "filter:topic.create",
            "method": "topicCreated"

    I tried using helpers.setupPageRoute on / but it simply doesn't work, probably because the route is being processed before the plugin routes are added.

    Is it possible to achieve what I want?

  • I guess preload hook is what I needed:

    plugin.preload = function (params, callback) {
   '/', function (req, res, next) {
            if ( {
            } else {

Log in to reply

Suggested Topics

| |