0

I'm having a bit of trouble that arose recently. We had installed a module called Ajaxify that we used as a base for getting some ajax-module things working. This used to work all fine and dandy but after some changes in our system setup (not sure if it was code-based or server configuration-based) it isn't working anymore.

The problem that we're having is that even though the URLs generate fine, when we visit them we get 302 redirects and that causes problems with Prototype's Ajax setup we have going on.

For example, it uses Mage::getUrl to generate all of the links. Mage::getUrl('ajaxify/index/reviews') returns http://mybaseurl.com/index.php/ajaxify/index/reviews/?productid=15&storeid=1&page=2. When I end up visiting this URL it redirects me to https://mybaseurl.com/index.php/ajaxify/index/reviews/ (note the lack of parameters, https, etc.)

Could it possibly be our server configuration? I've included our web setup for Magento URLs below. We are running Nginx so I'm not sure if that has anything to do with this or not. The funny thing is that this was working less than a week ago.

Image(I have ten rep why can't I post this image?): https://i.sstatic.net/06Qiw.png

Please note that if you would like to test out the functionality I am referencing you could replace mybaseurl.com with the URL linked in the picture. I just didn't want to publicly have that URL just sitting there. http://mybaseurl.com/citizen-tokyo. Once you are on the page feel free to click the read more link (near the bottom as an image button).

Thanks in advance and hopefully somebody can help me at least figure out why this is redirecting. Cheers!

1 Answer 1

3

It seems like an issue with your secure/unsecure URLs. Did you change this configuration recently?

Try: change Mage::getUrl('ajaxify/index/reviews') with Mage::getUrl('ajaxify/index/reviews', array('_secure',true)); this will force the request to be https://.

More information on this can be found in the magento wiki: http://www.magentocommerce.com/wiki/5_-_modules_and_development/reference/geturl_function_parameters

4
  • There might have been some changes to the nginx side of things, however the admin web url configuration has been the same for quite some time now. The problem is that we shouldn't even need the https for that url as it's part of the front-end. I've got no idea why it's redirecting a.) to https and b.) to /index.php/ajaxify/index/reviews.
    – tomatksand
    Commented Mar 30, 2013 at 16:11
  • Is there any output on this page? Nevertheless, using https:// all over is always a good idea for a webstore. Can you check if in System->Configuration->Web->Secure the checkbox "Use secure URL in frontend" is checked? And, have you tried my solution? Commented Mar 30, 2013 at 16:49
  • Use secure URL in frontend is set to no. I have checked on both store and default configuration to make sure this is the case.
    – tomatksand
    Commented Mar 30, 2013 at 17:01
  • Simon, I ended up abandoning that module and writing my own. Since doing that I haven't had any troubles with the rewriting or http/https troubles. Thanks for your assistance!
    – tomatksand
    Commented Mar 30, 2013 at 20:02

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.