View Full Version : Remove page-1 links to prevent duplicate content
Several people here were asking for a way to remove the page-1.html (?p=1) links from pagination to prevent duplicate content.
Here is a fix for this problem, I have altered the paging plugin!
If you have applied the previous fix I've posted here, remove it!!!
It works for both basic URLs (index.php?c=1&p=1) and friendly URLs (/category/subcategory/page-1.html).
Remove following code from /libs/smarty/plugins/function.paginate_first.php (lines #68-#69):
Content visible to registered users only.Look for following code in /libs/smarty/plugins/function.paginate_prev.php (lines #70-#71)
Content visible to registered users only.Replace with:
Content visible to registered users only.Look for following code in /libs/smarty/plugins/function.paginate_middle.php (lines #130-#131):
Content visible to registered users only.Replace with:
Content visible to registered users only.Boby
PS: To remove the old workaround, delete following code from your index.php file:
Content visible to registered users only.
thompson
12-13-2006, 11:29 AM
cool. i will try it in 3.1. thanks for that.
dave_gahan
12-13-2006, 12:36 PM
Big thanks, it works perfectly in version 3.0.6 ;).
best greetings
Dave
syscom
12-13-2006, 01:09 PM
many thanks
Ronny
thompson
12-13-2006, 03:33 PM
works with 3.1. perfect.
Dudley
12-13-2006, 03:53 PM
Boby, you da man! I have been trying to figure out how to properly rewrite the page-1 URLs for some time. They do show up as duplicate content in Google and I've seen those pages go into supplemental results.
This works perfect in 3.0.6. The mod should be included in all future version of the script.
Here is an additional fix that should remove the old duplicate URLs from Google's index and focus them on the proper version. You add this to the .htaccess file in the URL Rewrite Rules section.
RewriteRule ^(.*)/page-1\.html$ /$1/ [R=301,L]
sofie77
12-13-2006, 06:56 PM
its works with 2.0 aswell
but in one deep-category of my directory, i have more as 20 Sites. then it doesnt work anymore. can u tell me, where i can set the display pages higher to 30 for example? that should be enough space then...
because everything which is over 20 doestn display only if u click on forward at the end.... and this mess up the count..tx boby
Jim_Westergren
12-13-2006, 07:08 PM
Excellent!
Both the PHP and the .htaccess work!
Regine
12-15-2006, 04:41 AM
Thank you :-)
I'm glad you like it all :)
neurosis4u
12-17-2006, 02:11 PM
I got a problem wit pagination of search results if i insert this mod, please read here:
using the remove page-1 Mod (http://www.phplinkdirectory.com/forum/showthread.php?p=47535)
someone else with this problem? (version 3.1)
I've posted a FIX in my first (http://www.phplinkdirectory.com/forum/showpost.php?p=46945&postcount=1) post here for page 1 links and removed the first workaround!
Please remove the old workaround with the file you had downloaded and apply only the above fix!
Boby
mistyweb
04-06-2007, 10:27 PM
I did everything listed in top post but links still appear.
you can see it here: webpage-search.com
And where do you have a category with paging links?
PS: You don't have to post the same thing 3 times ;)
mistyweb
04-11-2007, 05:45 AM
Content visible to registered users only.
If my Posts would show up i would not try it 3 times, I finally though I posted here, my post was showing yesterday now it's gone?????
Content visible to registered users only.
On homepage there is links showing " prev 123456 next " with urls page-1.html, page-2.html etc.
url to directory is www. webpage-search .com
Content visible to registered users only.
If I click page 1 it won't build the url http://www.webpage-search.com/page-1.html but only http://www.webpage-search.com/ ... so it's working.
bobmutch
09-26-2007, 05:31 PM
We did the same thing.
We are considering removing the page-x.html and doing it this way.
/Recreation/Travel/
/Recreation/Travel2/
/Recreation/Travel3/
etc.
While it would be good for new installs it won't be a good mod for current installs that have 2nd pages as the 2nd/3rd/etc pages in the SE index would be dropped.
Any one have views on this?
vBulletin® v3.8.0, Copyright ©2000-2012, Jelsoft Enterprises Ltd.