PHP is popular programming or scripting language used to develop web pages. One of the problem developers face is using PHP to redirect user browser to the new page. for example we have an old URL but we want to make transition to the new url we can achieve this simply by using PHP redirect.
We will use header function of PHP to provide new URL to the client browser. Keep in mind that after using header function there should be no other operation that will output something or simple be sure header is last function.
In this example we will redirect current page to the
/*Provide new Location with header function*/
/*Be sure last output is from header function */
Please notice that we have used
exit() functin .This will make our page resource usage more effective.
window.location = "http://www.poftut.com/newurl";