Redirect, but keep uri the same
Moderator: General Moderators
Redirect, but keep uri the same
Is there any way WITHIN PHP or with headers to redirect somebody to a new location, but keep the URI the same (in the URL)?
- WaldoMonster
- Forum Contributor
- Posts: 225
- Joined: Mon Apr 19, 2004 6:19 pm
- Contact:
Code: Select all
<?php
header('Location: http://www.newlocation.com' . $_SERVER['REQUEST_URI']);
?>
Last edited by WaldoMonster on Tue Feb 20, 2007 7:42 pm, edited 1 time in total.
- WaldoMonster
- Forum Contributor
- Posts: 225
- Joined: Mon Apr 19, 2004 6:19 pm
- Contact:
if run form: http://www.oldsite.com/something/index.phpThe Ninja Space Goat wrote:wouldn't that just redirect me to the same page I'm on? I need to redirect to a new location.
it will redirect to: http://www.newlocation.com/something/index.php
If this is not what you want, please give an example.
- Kieran Huggins
- DevNet Master
- Posts: 3635
- Joined: Wed Dec 06, 2006 4:14 pm
- Location: Toronto, Canada
- Contact: