I have successfully managed to change the destination of CMS wysiwyg folder thanks to Marius, here but that is relative to media dir that is defauled to ./media.

Now I have made module to change the core fn getMediaDir but somehow I think it is somewhere else defined,, but I can't find where?

This is what I defined for module:


<?xml version="1.0"?>

and :

class Mk_Hub_Model_Core_Config_Options extends Mage_Core_Model_Config_Options

    public function getMediaDir()
        return $this->getBaseDir().DS.'media' . '/' . 'subdir1');
        // return $this->_data['media_dir'];

  • ...why would you do this?
    – Ryre
    Aug 13, 2013 at 15:33

3 Answers 3


I have never done this myself (the need has never occured)

Have a look at app/etc/config.xml, and you will find:


I am sure you can just change the default media path here by placing the directives in your app/etc/local.xml

  • HI @proxiblue, I tried that but that didn't worked.. I think that is used during setup for magento.. (the default values) right? Aug 13, 2013 at 7:41
  • Pity, was hoping this would be a quick fix. Maybe someone can shed some light what these are exactly for, and how they can be used....
    – ProxiBlue
    Aug 13, 2013 at 9:15

I didn't go down the rabbit hole all the way, but I did find an easy way and it's in the options in admin backend ( System -> Configuration -> General -> Web ) unsecure and secure. You can alter the Base media URL or any other if you need to.

Or you can do it programmatically like this:

Mage::getConfig()->saveConfig( 'web/unsecure/base_media_url', '{{unsecure_base_url}}media/subdir1/' );
  • If you don't want to persist it (calling saveConfig will store to db) you can set it just for this session by calling setConfig instead)
    – philwinkle
    Aug 13, 2013 at 15:08

You cannot rewrite the Mage_Core_Model_Config_Options class using XML rewrite because at the time the class Mage_Core_Model_Config_Options is initialised, Magento hasn't loaded the XML files. Look at the __construct function in the Mage_Core_Model_Config:

public function __construct($sourceData=null)
    $this->_options         = new Mage_Core_Model_Config_Options($sourceData);
    $this->_prototype       = new Mage_Core_Model_Config_Base();
    $this->_cacheChecksum   = null;

Magento does not use the Mage::getModel(...), it calls new Mage_Core_Model_Config_Options directly.

The only way to overwrite this class is to create the same file structure under local, so it will be local/Mage/Core/Model/Config/Options.php. But it is not recommended. :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.