lofaifa Posted October 21, 2011 Share Posted October 21, 2011 what the syntax to get out from the actual folder and redirect to some file outside ?? <?php header("Location: ???file.php"); exit; ?> Link to comment https://forums.phpfreaks.com/topic/249523-help-with-redirect/ Share on other sites More sharing options...
trq Posted October 21, 2011 Share Posted October 21, 2011 The location header expects a complete url. Link to comment https://forums.phpfreaks.com/topic/249523-help-with-redirect/#findComment-1281099 Share on other sites More sharing options...
lofaifa Posted October 21, 2011 Author Share Posted October 21, 2011 i am in the errors folder .. the php that i wanna redirect to is outside the errors folder , back to the main folder .. Link to comment https://forums.phpfreaks.com/topic/249523-help-with-redirect/#findComment-1281101 Share on other sites More sharing options...
floridaflatlander Posted October 21, 2011 Share Posted October 21, 2011 Quote i am in the errors folder .. the php that i wanna redirect to is outside the errors folder , back to the main folder .. like index.php /errors/index.php and your redirecting from /errors/index.php or what ever? header ("Location: ../index.php"); exit (); Link to comment https://forums.phpfreaks.com/topic/249523-help-with-redirect/#findComment-1281107 Share on other sites More sharing options...
trq Posted October 21, 2011 Share Posted October 21, 2011 As I said, the Location header expects a complete url. Using a path like floridaflatlander suggested is NOT recommended. Link to comment https://forums.phpfreaks.com/topic/249523-help-with-redirect/#findComment-1281265 Share on other sites More sharing options...
trq Posted October 21, 2011 Share Posted October 21, 2011 See section 14.30 of http://www.faqs.org/rfcs/rfc2616.html Link to comment https://forums.phpfreaks.com/topic/249523-help-with-redirect/#findComment-1281267 Share on other sites More sharing options...
floridaflatlander Posted October 22, 2011 Share Posted October 22, 2011 LOL Thanks thorpe that was about three hours work. I went back and changed all the header redirects to full urls on sites I've done. The odd thing I noticed was that a year ago to around May I was using complete urls, then in May I started using realtive paths, interesting. Link to comment https://forums.phpfreaks.com/topic/249523-help-with-redirect/#findComment-1281332 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.