Automatically return the visitor to the previous page












-2














When a visitor tries to access an old page that has been deleted
Or clicking on the wrong link for a page
Instead of moving to a 404 page, I want it to automatically return to the page where it was










share|improve this question


















  • 2




    I wouldn't do it since this may mislead or confuse the users. A better solution would be letting them know that the page they are looking for has been deleted.
    – enxaneta
    Dec 27 '18 at 20:00










  • Why are you asking about 404 error code while tagging this question with frontend related tags?
    – Alon Eitan
    Dec 27 '18 at 20:22












  • Well - I think there is a solution to the problem in another way I post a series of topics on my blog Every week i publish an article I put the previous and next article link in a manual way The problem is that the next article link after a week is published They are always redirected to a 404 page when they click the link on the next page I hope there is a way to automatically create links to previous pages and the next page when publishing a page
    – Piye Youi
    Dec 27 '18 at 20:34










  • Your users know where to find the back button in the browser (I promise). Reaching the 404 page doesn't have to be a bad thing, it clearly tells the user that whatever they were looking for isn't there anymore. The trick is to turn this 'roadblock' into a part of the user journey. "we didn't find A, but maybe you'll like B...". Check out the following article: smashingmagazine.com/2018/11/…
    – Wietse de Vries
    Dec 27 '18 at 21:28










  • If you must, you can try window.history.back();
    – Wietse de Vries
    Dec 27 '18 at 21:35
















-2














When a visitor tries to access an old page that has been deleted
Or clicking on the wrong link for a page
Instead of moving to a 404 page, I want it to automatically return to the page where it was










share|improve this question


















  • 2




    I wouldn't do it since this may mislead or confuse the users. A better solution would be letting them know that the page they are looking for has been deleted.
    – enxaneta
    Dec 27 '18 at 20:00










  • Why are you asking about 404 error code while tagging this question with frontend related tags?
    – Alon Eitan
    Dec 27 '18 at 20:22












  • Well - I think there is a solution to the problem in another way I post a series of topics on my blog Every week i publish an article I put the previous and next article link in a manual way The problem is that the next article link after a week is published They are always redirected to a 404 page when they click the link on the next page I hope there is a way to automatically create links to previous pages and the next page when publishing a page
    – Piye Youi
    Dec 27 '18 at 20:34










  • Your users know where to find the back button in the browser (I promise). Reaching the 404 page doesn't have to be a bad thing, it clearly tells the user that whatever they were looking for isn't there anymore. The trick is to turn this 'roadblock' into a part of the user journey. "we didn't find A, but maybe you'll like B...". Check out the following article: smashingmagazine.com/2018/11/…
    – Wietse de Vries
    Dec 27 '18 at 21:28










  • If you must, you can try window.history.back();
    – Wietse de Vries
    Dec 27 '18 at 21:35














-2












-2








-2


1





When a visitor tries to access an old page that has been deleted
Or clicking on the wrong link for a page
Instead of moving to a 404 page, I want it to automatically return to the page where it was










share|improve this question













When a visitor tries to access an old page that has been deleted
Or clicking on the wrong link for a page
Instead of moving to a 404 page, I want it to automatically return to the page where it was







javascript html css






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Dec 27 '18 at 19:50









Piye Youi

16




16








  • 2




    I wouldn't do it since this may mislead or confuse the users. A better solution would be letting them know that the page they are looking for has been deleted.
    – enxaneta
    Dec 27 '18 at 20:00










  • Why are you asking about 404 error code while tagging this question with frontend related tags?
    – Alon Eitan
    Dec 27 '18 at 20:22












  • Well - I think there is a solution to the problem in another way I post a series of topics on my blog Every week i publish an article I put the previous and next article link in a manual way The problem is that the next article link after a week is published They are always redirected to a 404 page when they click the link on the next page I hope there is a way to automatically create links to previous pages and the next page when publishing a page
    – Piye Youi
    Dec 27 '18 at 20:34










  • Your users know where to find the back button in the browser (I promise). Reaching the 404 page doesn't have to be a bad thing, it clearly tells the user that whatever they were looking for isn't there anymore. The trick is to turn this 'roadblock' into a part of the user journey. "we didn't find A, but maybe you'll like B...". Check out the following article: smashingmagazine.com/2018/11/…
    – Wietse de Vries
    Dec 27 '18 at 21:28










  • If you must, you can try window.history.back();
    – Wietse de Vries
    Dec 27 '18 at 21:35














  • 2




    I wouldn't do it since this may mislead or confuse the users. A better solution would be letting them know that the page they are looking for has been deleted.
    – enxaneta
    Dec 27 '18 at 20:00










  • Why are you asking about 404 error code while tagging this question with frontend related tags?
    – Alon Eitan
    Dec 27 '18 at 20:22












  • Well - I think there is a solution to the problem in another way I post a series of topics on my blog Every week i publish an article I put the previous and next article link in a manual way The problem is that the next article link after a week is published They are always redirected to a 404 page when they click the link on the next page I hope there is a way to automatically create links to previous pages and the next page when publishing a page
    – Piye Youi
    Dec 27 '18 at 20:34










  • Your users know where to find the back button in the browser (I promise). Reaching the 404 page doesn't have to be a bad thing, it clearly tells the user that whatever they were looking for isn't there anymore. The trick is to turn this 'roadblock' into a part of the user journey. "we didn't find A, but maybe you'll like B...". Check out the following article: smashingmagazine.com/2018/11/…
    – Wietse de Vries
    Dec 27 '18 at 21:28










  • If you must, you can try window.history.back();
    – Wietse de Vries
    Dec 27 '18 at 21:35








2




2




I wouldn't do it since this may mislead or confuse the users. A better solution would be letting them know that the page they are looking for has been deleted.
– enxaneta
Dec 27 '18 at 20:00




I wouldn't do it since this may mislead or confuse the users. A better solution would be letting them know that the page they are looking for has been deleted.
– enxaneta
Dec 27 '18 at 20:00












Why are you asking about 404 error code while tagging this question with frontend related tags?
– Alon Eitan
Dec 27 '18 at 20:22






Why are you asking about 404 error code while tagging this question with frontend related tags?
– Alon Eitan
Dec 27 '18 at 20:22














Well - I think there is a solution to the problem in another way I post a series of topics on my blog Every week i publish an article I put the previous and next article link in a manual way The problem is that the next article link after a week is published They are always redirected to a 404 page when they click the link on the next page I hope there is a way to automatically create links to previous pages and the next page when publishing a page
– Piye Youi
Dec 27 '18 at 20:34




Well - I think there is a solution to the problem in another way I post a series of topics on my blog Every week i publish an article I put the previous and next article link in a manual way The problem is that the next article link after a week is published They are always redirected to a 404 page when they click the link on the next page I hope there is a way to automatically create links to previous pages and the next page when publishing a page
– Piye Youi
Dec 27 '18 at 20:34












Your users know where to find the back button in the browser (I promise). Reaching the 404 page doesn't have to be a bad thing, it clearly tells the user that whatever they were looking for isn't there anymore. The trick is to turn this 'roadblock' into a part of the user journey. "we didn't find A, but maybe you'll like B...". Check out the following article: smashingmagazine.com/2018/11/…
– Wietse de Vries
Dec 27 '18 at 21:28




Your users know where to find the back button in the browser (I promise). Reaching the 404 page doesn't have to be a bad thing, it clearly tells the user that whatever they were looking for isn't there anymore. The trick is to turn this 'roadblock' into a part of the user journey. "we didn't find A, but maybe you'll like B...". Check out the following article: smashingmagazine.com/2018/11/…
– Wietse de Vries
Dec 27 '18 at 21:28












If you must, you can try window.history.back();
– Wietse de Vries
Dec 27 '18 at 21:35




If you must, you can try window.history.back();
– Wietse de Vries
Dec 27 '18 at 21:35












0






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',
autoActivateHeartbeat: false,
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%2f53950174%2fautomatically-return-the-visitor-to-the-previous-page%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53950174%2fautomatically-return-the-visitor-to-the-previous-page%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown