Categories - Next Page not working!?!

Found a bug? Tell us!!
Post Reply
KodrutZ
Regular
Posts: 17
Joined: Sun Dec 07, 2008 11:05 am
Location: Romania
Contact:

Categories - Next Page not working!?!

Post by KodrutZ »

Hello again, here's my new problem: if I press "Next page" from the home page of the blog, it works until the end. If I enter a category and press next page, it says no record found, although that category has enough posts for two pages. I checked for the missing sort_order field in the database, I noticed someone solved a similar issue this way, but it's there.

Link is www.nistorcodrut.com, try "Bancuri Tari" as category and press "Insemnarea urmatoare" to try and go to next page.

I have Serendipity 1.4.1, and my .htaccess file goes below:

Code: Select all

# BEGIN s9y
ErrorDocument 404 /index.php
DirectoryIndex /index.php

RewriteEngine On
RewriteBase /
RewriteRule ^serendipity_admin.php serendipity_admin.php [NC,L,QSA]
RewriteRule ^(([0-9a-z\.\_!;,\+\-\%]+\.html)/?) index.php?/$1 [NC,L,QSA]
RewriteRule ^(authors/[0-9a-z\.\_!;,\+\-\%]+) index.php?/$1 [NC,L,QSA]
RewriteRule ^(feeds/categories/([0-9;]+)-[0-9a-z\.\_!;,\+\-\%]+\.rss) index.php?/$1 [NC,L,QSA]
RewriteRule ^(feeds/authors/([0-9]+)-[0-9a-z\.\_!;,\+\-\%]+\.rss) index.php?/$1 [NC,L,QSA]
RewriteRule ^(categories/[0-9a-z\.\_!;,\+\-\%]+) index.php?/$1 [NC,L,QSA]
RewriteRule ^archives([/A-Za-z0-9]+)\.html index.php?url=/archives/$1.html [NC,L,QSA]
RewriteRule ^([0-9]+)[_\-][0-9a-z_\-]*\.html index.php?url=$1-article.html [L,NC,QSA]
RewriteRule ^feeds/(.*) index.php?url=/feeds/$1 [L,QSA]
RewriteRule ^unsubscribe/(.*)/([0-9]+) index.php?url=/unsubscribe/$1/$2 [L,QSA]
RewriteRule ^approve/(.*)/(.*)/([0-9]+) index.php?url=approve/$1/$2/$3 [L,QSA]
RewriteRule ^delete/(.*)/(.*)/([0-9]+) index.php?url=delete/$1/$2/$3 [L,QSA]
RewriteRule ^(admin|entries)(/.+)? index.php?url=admin/ [L,QSA]
RewriteRule ^archive/? index.php?url=/archive [L,QSA]
RewriteRule ^(index|atom[0-9]*|rss|b2rss|b2rdf).(rss|rdf|rss2|xml) rss.php?file=$1&ext=$2
RewriteRule ^(plugin|plugin)/(.*) index.php?url=$1/$2 [L,QSA]
RewriteRule ^search/(.*) index.php?url=/search/$1 [L,QSA]
RewriteRule ^comments/(.*) index.php?url=/comments/$1 [L,QSA]
RewriteRule ^(serendipity\.css|serendipity_admin\.css) index.php?url=/$1 [L,QSA]
RewriteRule ^index\.(html?|php.+) index.php?url=index.html [L,QSA]
RewriteRule ^htmlarea/(.*) htmlarea/$1 [L,QSA]
#RewriteCond %{REQUEST_URI} !-U
RewriteRule (.*\.html?) index.php?url=/$1 [L,QSA]

<Files *.tpl.php>
    deny from all
</Files>

<Files *.tpl>
    deny from all
</Files>

<Files *.sql>
    deny from all
</Files>

<Files *.inc.php>
    deny from all
</Files>

<Files *.db>
    deny from all
</Files>

# END s9y 
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Categories - Next Page not working!?!

Post by garvinhicking »

Hi!

It seems your installation cannot evaluate the permalink to reflect the current category.

Can you check your serendipity_permalinks DB table, see if it holds an entry for your categories? You should have an entry like:

Code: Select all

permalink:categories/Bancura-Tari
entry_id:23
type:category
As you changed your permalinks configuration (by default the %id% is contained in the permalink), how exactly did you set your permalinks and your path structures?

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
KodrutZ
Regular
Posts: 17
Joined: Sun Dec 07, 2008 11:05 am
Location: Romania
Contact:

Re: Categories - Next Page not working!?!

Post by KodrutZ »

The table is OK, or at least that's how it looks.

The permalinks are as it follows:

- Entry URL structure - %title%.html
- Author URL structure - authors/%realname%
- Category URL structure - categories/%name%
- RSS-Feed Category URL structure - feeds/categories/%id%-%name%.rss
- RSS-Feed Author URL structure - feeds/authors/%id%-%realname%.rss

Path to categories is set as "categories," of course.

That's it.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Categories - Next Page not working!?!

Post by garvinhicking »

Hi!

Hm, just to see if it works then, can you change your Category URL structure once to "categories/%id%-%name%/"?

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
KodrutZ
Regular
Posts: 17
Joined: Sun Dec 07, 2008 11:05 am
Location: Romania
Contact:

Re: Categories - Next Page not working!?!

Post by KodrutZ »

Done that, it worked. Now you can go to http://www.nistorcodrut.com/categories/1-Bancuri-Tari/, but when you click to go to next page, it shows an error, trying to load http://www.nistorcodrut.com/categories/ ... i//P2.html
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Categories - Next Page not working!?!

Post by garvinhicking »

Hi!

Hm, this is confusing, I don't really know why the permalinks don't properly work.

The P2.html error might happen because I told you the wrong permalink; try to use it without a "/" at the end, I'm sorry.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
KodrutZ
Regular
Posts: 17
Joined: Sun Dec 07, 2008 11:05 am
Location: Romania
Contact:

Re: Categories - Next Page not working!?!

Post by KodrutZ »

It's not that. http://www.nistorcodrut.com/categories/ ... ri/P2.html gives the same error. I think it has something to do with the .htaccess file and how it handles html files. Here's the file(I guess there are no major changes compared to what I pasted in the first post above, and I have to add this is placed in the root of my hosting account, so there are no rules inherited from any parent folder):

Code: Select all

# BEGIN s9y
ErrorDocument 404 /index.php
DirectoryIndex /index.php

RewriteEngine On
RewriteBase /
RewriteRule ^serendipity_admin.php serendipity_admin.php [NC,L,QSA]
RewriteRule ^(([0-9a-z\.\_!;,\+\-\%]+\.html)/?) index.php?/$1 [NC,L,QSA]
RewriteRule ^(authors/[0-9a-z\.\_!;,\+\-\%]+) index.php?/$1 [NC,L,QSA]
RewriteRule ^(feeds/categories/([0-9;]+)-[0-9a-z\.\_!;,\+\-\%]+\.rss) index.php?/$1 [NC,L,QSA]
RewriteRule ^(feeds/authors/([0-9]+)-[0-9a-z\.\_!;,\+\-\%]+\.rss) index.php?/$1 [NC,L,QSA]
RewriteRule ^(categories/([0-9;]+)-[0-9a-z\.\_!;,\+\-\%]+) index.php?/$1 [NC,L,QSA]
RewriteRule ^archives([/A-Za-z0-9]+)\.html index.php?url=/archives/$1.html [NC,L,QSA]
RewriteRule ^([0-9]+)[_\-][0-9a-z_\-]*\.html index.php?url=$1-article.html [L,NC,QSA]
RewriteRule ^feeds/(.*) index.php?url=/feeds/$1 [L,QSA]
RewriteRule ^unsubscribe/(.*)/([0-9]+) index.php?url=/unsubscribe/$1/$2 [L,QSA]
RewriteRule ^approve/(.*)/(.*)/([0-9]+) index.php?url=approve/$1/$2/$3 [L,QSA]
RewriteRule ^delete/(.*)/(.*)/([0-9]+) index.php?url=delete/$1/$2/$3 [L,QSA]
RewriteRule ^(admin|entries)(/.+)? index.php?url=admin/ [L,QSA]
RewriteRule ^archive/? index.php?url=/archive [L,QSA]
RewriteRule ^(index|atom[0-9]*|rss|b2rss|b2rdf).(rss|rdf|rss2|xml) rss.php?file=$1&ext=$2
RewriteRule ^(plugin|plugin)/(.*) index.php?url=$1/$2 [L,QSA]
RewriteRule ^search/(.*) index.php?url=/search/$1 [L,QSA]
RewriteRule ^comments/(.*) index.php?url=/comments/$1 [L,QSA]
RewriteRule ^(serendipity\.css|serendipity_admin\.css) index.php?url=/$1 [L,QSA]
RewriteRule ^index\.(html?|php.+) index.php?url=index.html [L,QSA]
RewriteRule ^htmlarea/(.*) htmlarea/$1 [L,QSA]
#RewriteCond %{REQUEST_URI} !-U
RewriteRule (.*\.html?) index.php?url=/$1 [L,QSA]

<Files *.tpl.php>
    deny from all
</Files>

<Files *.tpl>
    deny from all
</Files>

<Files *.sql>
    deny from all
</Files>

<Files *.inc.php>
    deny from all
</Files>

<Files *.db>
    deny from all
</Files>

# END s9y 
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Categories - Next Page not working!?!

Post by garvinhicking »

Hi!

Hm, your rewrite rules actually seem okay. The URL that you are using should actually work; on blog.s9y.org the same URL permalink style does work with pagination.

Maybe event plugins are interfering, I'm quite stumped. To inspect this issue completely, would it be possible for me to get temporary FTP access to your installation? This is currently the only way left for me to check what the real problem could be. If you'd like to try this, please send me a PM.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Categories - Next Page not working!?!

Post by garvinhicking »

Hi!

Thanks for giving me access, I was able to track down the error. your problem is that you configured the permalink for individual entries as / - usually, the default for this is "/archives".

Serendipity requires a fixed blog entry permalink path, because otherwise the different permalinks are getting confused. in your case, the permalink for entries ALSO applies to the /categories URL and thus, the categories page THINKS that it is acting as an entry URL, which is not available.

The error should go away, if you enter the permalink entry URL to something like /archives/%id%-%title%html. again ...

HTH,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
KodrutZ
Regular
Posts: 17
Joined: Sun Dec 07, 2008 11:05 am
Location: Romania
Contact:

Re: Categories - Next Page not working!?!

Post by KodrutZ »

So instead of having my posts as nistorcodrut.com/postname.html, I should have them as nistorcodrut.com/archives/postname.html? That's not good for SEO, I think...although this isn't quite a blog I want to monetize.
------------------------------------------------------
A few minutes later - it works with archives/%title%html as permalink for entries, but can't we find a workaround to have nistocodrut.com/postname.html as permalink for entries? :>
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Re: Categories - Next Page not working!?!

Post by judebert »

You've seen the first workaround, and it screws up categories.

The second workaround is to give each entry a custom permalink. That's just ugly and time-consuming.

However, the addition of a subdirectory -- archives/, entries/, whatever -- should have no effect on SEO. As long as the title is in there, SEO has something to search on. If it's after a query mark (like index.php?title=My-AWESOME-Article.html), it's a little less compelling. But a URL like my.domain.com/031.html is no good, and especially not my.domain.com/index.php?id=031.

Subdirectories shouldn't cause any problem at all.
Judebert
---
Website | Wishlist | PayPal
KodrutZ
Regular
Posts: 17
Joined: Sun Dec 07, 2008 11:05 am
Location: Romania
Contact:

Re: Categories - Next Page not working!?!

Post by KodrutZ »

Awesome, thanks a lot, judebert, you gave me an idea. Now the permalink for entries is archives/%title%, and it looks good. No more messing around with Serendipity for now, time to just add some content to that site! ;)
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Re: Categories - Next Page not working!?!

Post by Don Chambers »

judebert wrote:However, the addition of a subdirectory -- archives/, entries/, whatever -- should have no effect on SEO.
I am definitely NOT an SEO expert, but I do think that is entirely true... I believe some of these SEO calculations consider "distance from root" as a component of relevance.... ie, http:www.example.com/mypage.html would be considered more relevant than http://www.example.com/subfolder/mypage.html.

I know I have read this somewhere, but I cannot point to any particular authoritative source at the moment. But if we cannot do it, the point is moot. :wink:
=Don=
KodrutZ
Regular
Posts: 17
Joined: Sun Dec 07, 2008 11:05 am
Location: Romania
Contact:

Re: Categories - Next Page not working!?!

Post by KodrutZ »

I totally agree with you. I am no SEO expert, but I can easily setup a WordPress install to have articles climb up to Google's first page without doing anything imoral...and one of the tricks is to have custom permalinks like www.site.com/this-is-a-title/, apart from writing quality, original stuff, and choosing a fine niche.
akawappo
Posts: 3
Joined: Thu Nov 19, 2009 11:57 am
Location: Italy
Contact:

Re: Categories - Next Page not working!?!

Post by akawappo »

The Solution:

customize the categories as you want, and work on the include file functions_entries.inc.php

you can find it in the \include folder in the root of your blog

at line 841 you'll find

Code: Select all

$serendipity['smarty']->assign('footer_prev_page', serendipity_rewriteURL(implode('/', $uriArguments) . '.html'));
and at line 855 the following

Code: Select all

$serendipity['smarty']->assign('footer_next_page', serendipity_rewriteURL(implode('/', $uriArguments) . '.html'));

I had the same problem...after several experiments i found out that the second page of the category pagination ending in .htmL generated a 404 error

so I tried stripping the L from htmL suffix --------> magical spell: IT WORKED!

so i modded the include file in

Code: Select all

$serendipity['smarty']->assign('footer_prev_page', serendipity_rewriteURL(implode('/', $uriArguments) . '.htm'));
and

Code: Select all

$serendipity['smarty']->assign('footer_next_page', serendipity_rewriteURL(implode('/', $uriArguments) . '.htm'));

uploaded the include file and everything was OOOOOOOOOk

cheers

Sergio Gallo
aka
\\WappO


=======================
UPDATE
=======================

this mod works great for category pagination but skrews up the index pagination.... trying to fix it.... any help?
check my jobs at http://www.luckyproject.com/
and my News aggregator http://we.sgroomle.it/
Post Reply