Am trying to add secure URL to my custom module - below is my config.xml sample code


My need is to make myschemes url to access only through https:// if the user forced to load on non http i.e., http:// .

If i add secure url for myschemes then above rewrite is not working. If i enter https://www.example.com/myschemes/ as url it is redirecting to https://www.example.com/scheme/user//

How can I achieve this? Please help.

2 Answers 2


Interesting question, I was curious how this worked myself so I did a little digging. If you take a look at the standard router (Mage_Core_Controller_Varien_Router_Standard) you'll see that it makes a determination if a route should be secure by using _checkShouldBeSecure, which will in turn call _shouldBeSecure and this will ultimately call Mage_Core_Model_Config::shouldUrlBeSecure.

From here you can see that the way to force a URL to be secure is to declare the path so in your modules XML code. To take an example from core, which you can see in app/code/core/Mage/Customer/etc/config.xml.


I'm not sure about rewrites, but this is how you force secure urls on your own controller actions.


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.