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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.