Only redirect for html requests

This is needed for compatibility with [spree_minicart](https://github.com/sbounmy/spree_minicart), but might be a useful change in general.