madcrazy1 Posted September 28, 2007 Share Posted September 28, 2007 Hi, I have a php script that redirects the url input into the address bar by a surfer user types in address bar: mysite.com/usersite user gets to user site but the address bar now shows the redict url mysite.com/redir?usersiteid=389 this is the bit -o- code : header("Location: http://" . $_SERVER['HTTP_HOST'] . "/redir?usersite=$usersiteid"); } else { header("Location: http://" . $_SERVER['HTTP_HOST'] . "/infoseek.php");[ /code] what i want to happen is: the address bar keeps what the user types in and not the redirect url help please Link to comment https://forums.phpfreaks.com/topic/71074-hide-forwarded-url-in-address-bar/ Share on other sites More sharing options...
rarebit Posted September 28, 2007 Share Posted September 28, 2007 use 'mod_rewrite' from within '.htaccess'... Here's a forum http://forum.modrewrite.com/ Link to comment https://forums.phpfreaks.com/topic/71074-hide-forwarded-url-in-address-bar/#findComment-357363 Share on other sites More sharing options...
madcrazy1 Posted September 29, 2007 Author Share Posted September 29, 2007 thx will give them a try Link to comment https://forums.phpfreaks.com/topic/71074-hide-forwarded-url-in-address-bar/#findComment-357679 Share on other sites More sharing options...
madcrazy1 Posted October 10, 2007 Author Share Posted October 10, 2007 I tried them and they said they have limited php knowledge, they gave me this code, it works but a seach engine spider sees it as not found. help please. $requested = ereg_replace("/", '', $_SERVER['REQUEST_URI']); $RunThisQuery = "SELECT username, userid from frm_users where username = '$requested'"; $result = $connector->query($RunThisQuery); if ($connector->fetchNumResult($result) > 0) { $RunThisQuery = "SELECT username, userid from frm_users where username = '$requested'"; $result = $connector->query($RunThisQuery); while ( $row = $connector->fetchArray($result) ) { $_GET['id'] = $_REQUEST['id'] = $id = $row['userid']; } include('/var/www/html/biz/blog.php'); } else { header('Location: http://' . getenv('HTTP_HOST') . '/browse.php', true, 301); } Link to comment https://forums.phpfreaks.com/topic/71074-hide-forwarded-url-in-address-bar/#findComment-365946 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.