---json { "canonical": ":page:rules", "h1": "ComboStrap URL Management - Pages Rules", "page_id": "wx9h8eco3avtvqozkwy4h" } --- ====== ComboStrap Routing - Pages Rules ====== ===== About ===== ''page rules'' are rules that permits to apply a [[docs:router:permanent|permanent redirection]] for a page or a group of page. ===== Example ===== {{docs:router:page_rules_illustration.png|}} ==== Redirect all pages from the namespace ''database'' to ''db'' ==== With the below rule: * Pattern: ''database:*'' * Target: ''%%db:$1%%'' If a page called ''database:table'' does not exist, the router will calculate the target page ''db:table'' and if the page exists, it will [[transparent|rewrite it]]. ==== Redirect a page to an external web site ==== With the below rule: * Pattern: ''dokuwiki:404managerplugin'' * Target: ''https://combostrap.com/url/manager'' If a page called ''dokuwiki:404managerplugin'' does not exist, the router will send a [[permanent|permanent redirect]] to the page ''https://combostrap.com/url/manager'' ===== Steps ===== ==== Go to the new rule page ==== * Go to the [[doku>admin_window|admin window]] (ie ''https://yourdomain.com/dokuwiki/?do=admin'') * Click the ''ComboStrap - Page Rules'' link * Click the button ''Add a new rule'' ==== Create a rule ==== * The matcher is a pattern that should match the missing Dokuwiki Id. You can use one or more ''*'' that match any number of characters (including none). * The target is the new page. The ''%%$1, $2, ...%%'' characters correspond to the value of the star character ''*'' in order and you can use them to define the target page * The priority defines in which order, the page rules are applied.