Answers.Body: <p>This works for me:</p>
  
  <pre><code>public function registerCpRoutes()
  {
      return array(
          'settings/plugins/pluginname/index' =&gt; 'pluginname/index'
      );
  }
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-10-27T07:51:05.223Z
Answers.Text: do I need to add `settings` anyway?
Answers.UserDisplayName: Volatil3
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-10-28T00:11:40.667Z
Answers.Text: You don't have to have settings.
Answers.UserDisplayName: a-am
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-10-26T18:26:22.473Z
Answers.LastActivityDate: 2015-10-26T18:26:22.473Z
Answers.UserDisplayName: carlcs
Body: <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>
  
Tags: <plugin-development><templating>
Title: How to override default root URL of plugin?
ThreadText: # 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.  
  
  ---
  
  