title: Override an AdminHtml controller in back-office
body: <p>I want to override the class <code>Mage_Adminhtml_Catalog_CategoryController</code> (controller for categories in Magento back-office). I think that my config.xml is wrong somewhere and I suspect the <code>&lt;to&gt;</code> tag to be the problem. When I try to access <a href="http://mywebsite/index.php/admin_k/catalog_category/index/key/somerandomkey/" rel="nofollow noreferrer">http://mywebsite/index.php/admin_k/catalog_category/index/key/somerandomkey/</a>, I have a 404 error.</p>
  
  <p>My config.xml :</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;config&gt;
    &lt;modules&gt;
      &lt;Cheek_Lookbook&gt;
        &lt;version&gt;0.0.1&lt;/version&gt;
      &lt;/Cheek_Lookbook&gt;
    &lt;/modules&gt;
    &lt;global&gt;
          &lt;rewrite&gt;        
              &lt;cheek_lookbook_adminhtml_catalog_categorycontroller&gt;
                  &lt;from&gt;&lt;![CDATA[#^/admin_k/catalog_category/#]]&gt;&lt;/from&gt; 
                  &lt;to&gt;/admin_k/lookbook/adminhtml_catalog_category/&lt;/to&gt;
              &lt;/cheek_lookbook_adminhtml_catalog_categorycontroller&gt;
          &lt;/rewrite&gt;
      &lt;helpers&gt;
        &lt;lookbook&gt;
          &lt;class&gt;Cheek_Lookbook_Helper&lt;/class&gt;
        &lt;/lookbook&gt;
      &lt;/helpers&gt;
          &lt;blocks&gt;
              &lt;lookbook&gt;
                  &lt;class&gt;Cheek_Lookbook_Block&lt;/class&gt;
              &lt;/lookbook&gt;
              &lt;adminhtml&gt;
                  &lt;rewrite&gt;
                      &lt;catalog_category_tab_product&gt;Cheek_Lookbook_Block_Adminhtml_Catalog_Category_Tab_Product&lt;/catalog_category_tab_product&gt;
                  &lt;/rewrite&gt;
              &lt;/adminhtml&gt;
          &lt;/blocks&gt;
          &lt;resources&gt;
              &lt;lookbook_setup&gt;
                  &lt;setup&gt;
                      &lt;module&gt;Cheek_Lookbook&lt;/module&gt;
                  &lt;/setup&gt;
                  &lt;connection&gt;
                      &lt;use&gt;core_setup&lt;/use&gt;
                  &lt;/connection&gt;
              &lt;/lookbook_setup&gt;
              &lt;lookbook_write&gt;
                  &lt;connection&gt;
                      &lt;use&gt;core_write&lt;/use&gt;
                  &lt;/connection&gt;
              &lt;/lookbook_write&gt;
              &lt;lookbook_read&gt;
                  &lt;connection&gt;
                      &lt;use&gt;core_read&lt;/use&gt;
                  &lt;/connection&gt;
              &lt;/lookbook_read&gt;
          &lt;/resources&gt;
    &lt;/global&gt;
      &lt;admin&gt;
          &lt;routers&gt;
              &lt;lookbook&gt;
                  &lt;use&gt;admin&lt;/use&gt;
                  &lt;args&gt;
                      &lt;module&gt;Cheek_Lookbook&lt;/module&gt;
                      &lt;frontName&gt;admin_lookbook&lt;/frontName&gt;
                  &lt;/args&gt;
              &lt;/lookbook&gt;
          &lt;/routers&gt;
    &lt;/admin&gt;
  &lt;/config&gt; 
  </code></pre>
  
  <p>I've tried a lot of things (adding, <code>/lookbook/</code> after <code>/admin_k</code> in the URL, tweak the value in <code>&lt;to&gt;</code> ...) but I can't figure what's wrong.</p>
  
  <p>Here, my controller class :</p>
  
  <pre><code>&lt;?php
  require_once "Mage/Adminhtml/controllers/Catalog/CategoryController.php";  
  class Cheek_Lookbook_Adminhtml_Catalog_CategoryController extends Mage_Adminhtml_Catalog_CategoryController {
  
      public function postDispatch()
      {
          parent::postDispatch();
          Mage::dispatchEvent('controller_action_postdispatch_adminhtml', array('controller_action' =&gt; $this));
      }
  
      public function indexAction() 
      {
          Mage::log('There we aren't', null, 'someRandomLogs.log');
          parent::indexAction();
      }
  }
  </code></pre>
  
  <p>Does anybody have an idea ?</p>