Jump to content

.htaccess php extension redirects


defeated

Recommended Posts

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;
}

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).

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.