首页 > 解决方案 > Why does the url not change upon redirection in php?

问题描述

I have a website based on PHP (with MySQL, Javascript, and JQuery)

Its URL remains unchanged even after the redirection to a new page. This happens for all redirections. If I open the link in a new tab, it will work fine and display the entire new URL but not on the same page. I do not get this issue on localhost, only on the server. What should I do to prevent that?

eg. mywebsite.com redirection to page1 should look like: mywebsite.com/page1 but it doesn't change at all.

The redirection methods that I use is either:

header("Location: ../index.php?Login=error3");

or

 <a href="Forms/LogIn.php" class="btn btn-primary">Button</a>

Both redirection types do not change the URL.

标签: phpapache

解决方案


推荐阅读