Closed (fixed)
Project:
Clean Pagination
Version:
7.x-1.0
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
21 Sep 2011 at 01:01 UTC
Updated:
5 Sep 2012 at 12:11 UTC
and some other common settings?
right now I have:
catalog/*
node
blog/*
the blog/* seems to work. the catalog/* seems to work well for my ubercart catalog...
For the frontpage, i dont think i have it setup correctly. As when the frontpage (www.mysite.com) makes another page url at the bottom, it looks like:
http://www.mysite.com/node/page/1
However, when i click on it, it goes to:
http://www.mysite.com/?page=1
I'd want the url to stay the same just like the others do
I have in my .htaccess to handle the urls:
RewriteRule (.*)/page/([0-9]*)$ $1&page=$2 [L,QSA]
Just not sure why it can't handle the frontpage
Comments
Comment #1
j_ten_man commentedThis definitely seems like an issue with your rewrite rule. I'm not able to duplicate but I'm far from an expert on .htaccess files and rewrite rules.
Comment #2
armyofda12mnkeys commentedWell ... just some follow up questions.... to use Clean Pagination, you would need the rewrite rule I posted, right?
Or does the rewrite definately conflict ... ?
I forget, but I think I left it in as I thought Clean Pagination rewrites the ?page=1 to /page/1 and the rewrite rule keeps it that way when you click on it (so it doesn't revert to ?page=1 in the browser address bar).
For Clean Pagination to handle the front page, what is your setting to cover that? like i just use 'node' assume it applies to front page, or would you use '/'.
Comment #3
j_ten_man commentedThe whole point of Clean Pagination is so that you don't need to use rewrite rules. It rewrites ?page=1 to /page/1 and leaves it that way in the address bar.
You are correct in assuming that if your front page is node then that is what you need to put in the settings for the url. Your rewritten urls will look like node/page/1, node/page/2, etc and they will be that way on the pager at the bottom and in the address bar.
Comment #4
armyofda12mnkeys commentedHmmm, well...
If I get rid of that .htaccess rule,
then for example on the front page it will list the url for the 2nd page:
http://mysite.com/node/page/1
Seems like Clean Pagination module rewrote this address (without your module, it would be http://mysite.com/?page=1 i think) ... but ... when you actually click on it... it goes to the correct page but... the url in the address bar is:
http://mysite.com/?page=1
I use BOOST and BOOST .htaccess settings are the only other thing added in the .htaccess file. not sure if that makes a difference.
I think If i add this rule to cover the front page explicitly, then everything works as expected:
Comment #5
j_ten_man commentedRewriteRule node/page/([0-9]*)$ ?page=$1 [L,QSA]This rewrite rule is what is doing it. I don't have an experience with Boost, so not sure what this is for, but this rule is rewriting it in your address bar.
Comment #6
sonar_un commentedI am actually getting the same problem with the front page pager that is explained in the first post.
I am using Drupal 7's default .htaccess file.
If I enable the 301 redirect in the -dev version, I get a redirect loop.
Strange.
Comment #7
j_ten_man commented@sonar_un - That is weird. I'm not sure what's causing it. Possibly some type of setup or module conflict? I've just tested again with the latest code and default .htaccess file and I'm not seeing any issues.
Comment #8
sonar_un commentedSo I looked into this a little bit, and it turns out that if I disable the Global Redirect module, then the front page pagination works.
Obviously that would make sense a little bit. But I would really like the global redirect module enabled for SEO purposes (which is kind of the same reason why I was looking at the clean pagination module)
I am not sure how I can trace this issue though, I would like to help more if I can.
Comment #9
j_ten_man commentedJust committed a workaround/fix for this. It is in the latest dev version. Please update and validate that it works.
Comment #10
sonar_un commentedSorry it took me so long to look into this further.
This is what I found. With the settings enabled, and the pagination working for "node". On the front page, the numbers work properly, leaving you with sitename.com/1 and sitename.com/2 ...etc for the pages. When you click on the links, that works properly as well. However, the pagination for the second page shows this "sitename.com/node/1?destination=1". It doesn't page to any additional page properly. Plus, the title says "Visit node Page 2" instead of just the number 2, like it does for the front page.
I hope that's clear :)
Thanks for your help!
Comment #11
sonar_un commentedA little more information..
When I unclick use SEO Links, the "visit node page 2" disappears, and just shows the number 2, which is great. However the pagination doesn't take you to the proper pages unfortunately. If I click on 3, it takes me back to page 1.
Comment #12
j_ten_man commentedI'm still unable to duplicate. Do you have the latest dev version?
Since you aren't using the 'page/page_number' setting, the other thing I can recommend trying is to make sure you have a blank line in the list of pages. For example:
Basically, just make sure you have a blank line in there, otherwise it can't figure things out.
Comment #13
sonar_un commentedYep, I definitely have the latest dev version. But it could be that there is yet another module that is interacting with this one causing this unexpected behavior. Unfortunately I am not enabling this module in a clean environment.
Comment #14
mkhare commentedThe issue with Global Redirects seems to be the Frontpage Redirect Handler. Leave it checked and you get "sitename/?page=1" when you go to the second page. Uncheck it and Clean Pagination works for the front page, returning "sitename/node/page/1" so you don't have to completely turn off Global Redirects. However, this raises a new issue. With the redirect handler turned off, when you click on "First" or "1" on the pager at the bottom, it will bring you to "sitename/node' instead of the sitename root, which means you have a duplicate front page, the root and node. So there appears to be a conflict of some sort between Global Redirects and Clean Pagination over the redirects to the home or front page.
I know little about .htaccess and redirects. If anyone could look into this and find a solution, I would appreciate it.
Comment #15
j_ten_man commentedWhat version of the module do you have?
Also, when you hover over 1 or first, are the urls correct or do they have "/node" in them?
Comment #16
mkhare commentedI'm using Clean Pagination Version 7.x-1.0-alpha 4 and Global Redirects 7.1x-1.5. When on the homepage, hovering over the link for "2", gets me the URL "sitename/node/page/1". When I click on the link, I get the same in the browser search bar. On the second or third page, hovering over "first" gets me "sitename/node" and clicking it brings me to that URL. I use Clean pagination for other parts of my site and it works differently: my blog returns "sitename/blog" and "sitename/blog/page/1" respectively.
I should note that so far Google Webmaster Tools has not shown this to cause a duplicate page because I set the canonical link to absolute in the Meta Tags module. As a result, "sitemap/node" shows "sitemap" as the canonical reference.
Comment #17
j_ten_man commentedI believe this is actually fixed in the latest dev release because I don't have this issue on my test environment (the urls are generating as "sitename/page/1" and "sitename" for the frontpage. If you could verify that the latest dev code works for you then I'll create a new release with this fix in it - there are mostly just bug fixes in the latest dev release. A couple of other features such as the ability to turn on rel="next" and rel="prev" links on pagers as well.
Also, see comment 12 from above (you'll need the blank line in your settings): http://drupal.org/node/1285824#comment-5781314
Comment #18
mkhare commentedYes, the latest dev code works. I get "sitename" and "sitename/page/1" without /node. I also tested it with the Global Redirects Front Page Handler re-enabled and it works fine.
The 301 redirect feature is especially nice. Now I have to wait and see if this fixes the separate problem that cropped up in the last couple of days: Google flagged all the pages with pagination as duplicates, listing them as "sitename/?page=1" or "sitename/directory?=1" even though the url read "sitename/directory/page/1".
Thanks for the help! I appreciate it.
Comment #19
j_ten_man commentedComment #20
j_ten_man commented