See Bharath's answer to a similar question here:
Excel Hyperlinks redirecting to login
- Create a redirect.html page in your public folder (public folder because you are using ROR)
- Copy this to your redirect.html
<html>
<body>
Please wait, loading your page...
<script type="text/javascript">
function getQuerystring(key) {
key = key.replace(/[\[]/,"\\\[").replace(/ [\]]/,"\\\]");
var regex = new RegExp("[\\?&]"+key+"=([^&#]*)");
var query = regex.exec(window.location.href);
return query[1];
}
window.location = "http://" + window.location.host + "/" + getQuerystring('page');
</script>
</body>
</html>
The links you are constructing in excel should be modified
For e.g Old link - http://test.com/post/comments/1 New link should be
- http://test.com/redirect.html?page=post/comments/1
You need to pass the part of URL (after base url) as a param How this
works.
When user clicks a link in excel it points to redirect.html and the
javascript constructs the actual URL and redirects again to proper
page, user will be navigated to actual page if already logged in else
redirected to Login/Home page.