Pager, first page link
| From: | Juan Fco. Giordana | Date: | Thu, 04 Feb 2010 08:15:41 +0000 |
| Subject: | Pager, first page link | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-30252@lists.php.net to get a copy of this message | ||
Hello,
I couldn't find an answer to this anywhere, could be maybe a feature request too.
The thing is that I use the Pager class to make pretty URLs on the websites I develop. The links structure I create is as follows:
/category/
/category/page2/
/category/page3/
...
/category/pageN/
Then, the problem appears when I print the list of pages:
<?php
echo $pager->getLinks();
?>
/category/ and /category/page1/
Both links print the same content which causes search engines to trigger a warning about duplicate content on my sites.
I know I could use a 301 redirect or <link rel="canonical" /> and a few more tricks but what I'd like to do is to set the first page link to point to the URL of my choice.
I couldn't find a way to do this on the Pager docs and that is the cause of this e-mail.
Thanks in advance for any tips on the subject.
Regards.