<p>This works for me:</p>

<pre><code>public function registerCpRoutes()
{
    return array(
        'settings/plugins/pluginname/index' =&gt; 'pluginname/index'
    );
}
</code></pre>

CC BY-SA 3.0
2015-10-27T07:51:05.223Z
do I need to add `settings` anyway?
Volatil3
CC BY-SA 3.0
2015-10-28T00:11:40.667Z
You don't have to have settings.
a-am
CC BY-SA 3.0
2015-10-26T18:26:22.473Z
2015-10-26T18:26:22.473Z
carlcs
<p>how can I override default root URL behavior via routes? I did following but not working:</p>

<pre><code>'pluginname/' =&gt; array('action' =&gt; 'pluginName/Controller/actionName');
</code></pre>

<p>my template file name is <code>index</code></p>

<plugin-development><templating>
How to override default root URL of plugin?
# How to override default root URL of plugin?

(Asked by: username_0 on 2015-10-26)

how can I override default root URL behavior via routes? I did following but not working:
'pluginname/' => array('action' => 'pluginName/Controller/actionName');

my template file name is index

**Tags:** plugin-development, templating


---

## 1 answers

### Answer by username_1 on 2015-10-26. Score: 1

This works for me:
public function registerCpRoutes()
{
    return array(
        'settings/plugins/pluginname/index' => 'pluginname/index'
    );
}

> **Comments:**
> **username_0**: do I need to add `settings` anyway?  
> **username_2**: You don't have to have settings.  

---

