herokuapp.com redirects twice unexpectedly to www.app.com

Multi tool use
Multi tool use











up vote
0
down vote

favorite












my uni group are working for a client, and we have a Heroku app set up to handle the server side of things. I'm currently working on an AJAX login function, but I am redirected automatically - and that's the problem: there isn't supposed to be any redirect. It's coming from Heroku, not our code.



Our Heroku as a REST API returns exclusively JSON perfectly fine, using the URL https://blah.herokuapp.com/ (200), until I send an AJAX request via JS or JQuery: it redirects to https://blah.heroku.app.com/ (301), which redirects to www.app.com (200).



When you try to access that second one with the extra ., it redirects straight to www.app.com, which is how I know that it's Heroku. Edit: I tested someone elses Heroku app, and it does the same thing when you add the extra ..



I'm at a loss as to why it redirects to the second one, or why Heroku redirects to a dodgy site. Any ideas?










share|improve this question
























  • Turns out that app.com is the top level domain. So the extra period is cutting off the heroku and appname. So that's how we end up at www.app.com.
    – Scruffy
    yesterday















up vote
0
down vote

favorite












my uni group are working for a client, and we have a Heroku app set up to handle the server side of things. I'm currently working on an AJAX login function, but I am redirected automatically - and that's the problem: there isn't supposed to be any redirect. It's coming from Heroku, not our code.



Our Heroku as a REST API returns exclusively JSON perfectly fine, using the URL https://blah.herokuapp.com/ (200), until I send an AJAX request via JS or JQuery: it redirects to https://blah.heroku.app.com/ (301), which redirects to www.app.com (200).



When you try to access that second one with the extra ., it redirects straight to www.app.com, which is how I know that it's Heroku. Edit: I tested someone elses Heroku app, and it does the same thing when you add the extra ..



I'm at a loss as to why it redirects to the second one, or why Heroku redirects to a dodgy site. Any ideas?










share|improve this question
























  • Turns out that app.com is the top level domain. So the extra period is cutting off the heroku and appname. So that's how we end up at www.app.com.
    – Scruffy
    yesterday













up vote
0
down vote

favorite









up vote
0
down vote

favorite











my uni group are working for a client, and we have a Heroku app set up to handle the server side of things. I'm currently working on an AJAX login function, but I am redirected automatically - and that's the problem: there isn't supposed to be any redirect. It's coming from Heroku, not our code.



Our Heroku as a REST API returns exclusively JSON perfectly fine, using the URL https://blah.herokuapp.com/ (200), until I send an AJAX request via JS or JQuery: it redirects to https://blah.heroku.app.com/ (301), which redirects to www.app.com (200).



When you try to access that second one with the extra ., it redirects straight to www.app.com, which is how I know that it's Heroku. Edit: I tested someone elses Heroku app, and it does the same thing when you add the extra ..



I'm at a loss as to why it redirects to the second one, or why Heroku redirects to a dodgy site. Any ideas?










share|improve this question















my uni group are working for a client, and we have a Heroku app set up to handle the server side of things. I'm currently working on an AJAX login function, but I am redirected automatically - and that's the problem: there isn't supposed to be any redirect. It's coming from Heroku, not our code.



Our Heroku as a REST API returns exclusively JSON perfectly fine, using the URL https://blah.herokuapp.com/ (200), until I send an AJAX request via JS or JQuery: it redirects to https://blah.heroku.app.com/ (301), which redirects to www.app.com (200).



When you try to access that second one with the extra ., it redirects straight to www.app.com, which is how I know that it's Heroku. Edit: I tested someone elses Heroku app, and it does the same thing when you add the extra ..



I'm at a loss as to why it redirects to the second one, or why Heroku redirects to a dodgy site. Any ideas?







heroku






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited yesterday

























asked yesterday









Scruffy

13




13












  • Turns out that app.com is the top level domain. So the extra period is cutting off the heroku and appname. So that's how we end up at www.app.com.
    – Scruffy
    yesterday


















  • Turns out that app.com is the top level domain. So the extra period is cutting off the heroku and appname. So that's how we end up at www.app.com.
    – Scruffy
    yesterday
















Turns out that app.com is the top level domain. So the extra period is cutting off the heroku and appname. So that's how we end up at www.app.com.
– Scruffy
yesterday




Turns out that app.com is the top level domain. So the extra period is cutting off the heroku and appname. So that's how we end up at www.app.com.
– Scruffy
yesterday

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














 

draft saved


draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53204306%2fherokuapp-com-redirects-twice-unexpectedly-to-www-app-com%23new-answer', 'question_page');
}
);

Post as a guest





































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















 

draft saved


draft discarded



















































 


draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53204306%2fherokuapp-com-redirects-twice-unexpectedly-to-www-app-com%23new-answer', 'question_page');
}
);

Post as a guest




















































































nh9NePEG5MhVdlwgA4tbbvKsZ8ATc4c BKBy9 QzCc1H2q1trpVuT Dtdd,9cevw6Q m lQYA
6qaxg 0NZyf0y32ActdjU59FzZzWOMazk8Wr6rsVCx5

Popular posts from this blog

How to pass form data using jquery Ajax to insert data in database?

Guess what letter conforming each word

Run scheduled task as local user group (not BUILTIN)