defeated Posted July 28, 2008 Share Posted July 28, 2008 Hi, How do I go about redirecting from http://www.jackiebrownmedical.ie/jobs_ireland.php?url=jobs to http://www.jackiebrownmedical.ie/jobs_ireland.php?url=jobs&page=1 ??? Ian. Quote Link to comment https://forums.phpfreaks.com/topic/117011-htaccess-php-extension-redirects/ Share on other sites More sharing options...
wildteen88 Posted July 28, 2008 Share Posted July 28, 2008 It would be better if this is handled by PHP instead, what you want to do doesn't require a redirect. // check 'page' is set in to the url if(isset($_GET['page']) && is_numeric($_GET['page'])) { // set $page variable $page = $_GET['page']; } else { // set page to 1 by default. $page = 1; } Quote Link to comment https://forums.phpfreaks.com/topic/117011-htaccess-php-extension-redirects/#findComment-601898 Share on other sites More sharing options...
defeated Posted July 28, 2008 Author Share Posted July 28, 2008 Thanks but it does that already. My reason for asking is purely for google and getting around duplicate content. jobs_ireland.php?url=jobs exists in the index but I want to get rid of it. I have changed my sitemap to reflect page=1-whatever and I have changed all my links to say page=1 but I need a permanent redirect to get rid of the original without page=. I have tried a few things but keep on getting redirect loops. Maybe it's not possible and/or there is a better way to do it. Somebody on another forum suggested I redirect from url=jobs&page=1 to url=jobs but that would cause me major headaches with having to rewrite code that I'm already struggling with in the pagination itself and again in my sitemap (sitemap is dynamic and lists each paginated page). Quote Link to comment https://forums.phpfreaks.com/topic/117011-htaccess-php-extension-redirects/#findComment-601932 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.