bwhite Posted May 7, 2013 Share Posted May 7, 2013 I have remade my company webpage using very little php mostly because I don't know it however the last web designer seemed to love it and now all the links that are out in the big www start with "?p=" and I can't do a 301 redirect on those pages. how do I rewrite those links as they are coming in to change ?p=page to page/php so I can properly redirect them in my htaccess file. Redirect 301 /?p=oldpage http://www.mypage.com/newpage.php/ won't redirect Redirect 301 /oldpage.php http://www.mypage.com/newpage.php/ will redirect I found this in his index.php file and I think thats what he used to change the .php to ?p= $page = (isset($_GET['p']) ? $_GET['p'] : $homePage);$page = basename($page);$page = str_replace(".php","",$page); if(!file_exists($page . '.php')){ $page = $errorPage; Quote Link to comment https://forums.phpfreaks.com/topic/277764-str_replace-help/ Share on other sites More sharing options...
ginerjm Posted June 5, 2013 Share Posted June 5, 2013 Yes - that section is what you think it is. So - if you have used "some" php, why not continue to use this part as well? His use of "?p=xxx" is not just the use of PHP, it is a standard url with a GET parm. Or are you looking for some php code to resolve the existing urls? Or are you done with this problem? Quote Link to comment https://forums.phpfreaks.com/topic/277764-str_replace-help/#findComment-1434243 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.