WordPress.org

Ready to get started?Download WordPress

Forums

nextpage not working with permalinks (13 posts)

  1. chemoul
    Member
    Posted 8 years ago #

    Hi,

    I tried to split a post into several pages, using the nextpage tag,
    but it when I click on the "next" link in the post (i.e. http://thevital.net/digitalcamera/by-manufacturer/nikon/nikon-coolpix-8800/2/)
    I get a 404 Error.
    I've read the forum posts on this issue and also the Doc on Permalinks
    but updating and recreating the htaccess is not working.

    Any other suggestions?

    Thanks.

    Steve

  2. davidhouse
    Member
    Posted 8 years ago #

    Well, if you chop the /2/ off at the end you still get a 404, meaning that that page doesn't exist.

  3. moshu
    Member
    Posted 8 years ago #

    Where did you get that "by-manufacturer" in your permalinks structure? I cannot find it anywhere else on your site.

  4. chemoul
    Member
    Posted 8 years ago #

    The page without the /2 doesn't exist because I marked the post
    private so that noone else sees the 404 error until I figured out
    what's wrong with it.
    The "by manufacturer" is the parent category. By manufacturer, then
    all the camera manufacturers underneath. I don't have any posts in
    the parent category, that's why it's not showing up (I guess?).

    Thank you for your help.

    Steve

  5. moshu
    Member
    Posted 8 years ago #

    1. If you make it private we will never be able to troubleshoot.
    2. I still don't understand what you say about that "by-manufacturer" category because:
    - clicking on your categories in the sidebar it shows a different permalink structure = namely one that has the default "category" in it
    - when you have this "by-manufacturer" the word category is missing, so it cannot be a normal category/subcat/file thing.

    What are we missing?

  6. chemoul
    Member
    Posted 8 years ago #

    I have 2 parent categories named:
    "By manufacturer"
    and
    "Reviews"

    The subcategories for each of the 2 parent categories are the
    manufacturer's names, such as Canon, Sony, etc.

    What you see as categories on the website at the moment are the
    subcategories of the "Reviews" parent category as I only have 1
    post in the "By manufacturer" category and that's the one that's
    marked as private.
    What I don't understand is why the parent category "Reviews" isn't
    displayed above the links to the manufacturer category.

    I know what you mean however, it is strange that the category links have a "category" in them, e.g.
    http://thevital.net/digitalcamera/CATEGORY/reviews/canon/
    but when you click on a post itself, there is no "category" in the link, e.g.
    http://thevital.net/digitalcamera/reviews/canon/canon-powershot-s80-review-at-letsgodigital

    I cannot explain this and I don't know whether this is normal or not?

    I have now published the post in question. Active category is "Nikon"
    underneath the parent category "By manufacturer". "By manufacturer"
    itself has not been selected, which is why it won't show up in the
    category list. You can see however that there are two "Nikon"
    categories now, one is the subcategory of "By manufacturer", one is
    the subcategory of "Reviews" ("Reviews" itself doesn't show, because
    there is no post in it.

    I've also tried to check both "Nikon" and "By manufacturer" for the
    post in question, but I still get the 404 error when I click on the
    next page link.

    Thank you for your help.

    Steve

  7. moshu
    Member
    Posted 8 years ago #

    Here is what I think - and I don't claim to be 100% right.
    1. The parent categories not being displayed. It might be because WP by default doesn't show the empty categories. You can change that parameters by checking which [[Template_Tags#Category_tags]] are used in your theme and adding the proper parameter
    2. The word "category" will appear only in category links - not in the individual permalinks to the posts.
    3. I think WP doesn't like to have 2 categories with the same name - even if they are children of different parent categories. Seemingly this confuses the engine: if I click on the "nikon" category showing to have only 1 (one) post in it, which is supposed to be the "by-manufacturer" child... it will display ALL the posts from the other "nikon" category.
    4. Not sure, but the "next-page" not working might also be related to this.

  8. chemoul
    Member
    Posted 8 years ago #

    Thank you for your reply.

    I've changed the category for the post to "uncategorized". This
    category is unique. Unfortunately, the problem 404 still exists.

    Is anyone actually using the nextpage functionality in combination
    with permlinks on their site successfully?

    Thanks.

    Steve

  9. chemoul
    Member
    Posted 8 years ago #

    It seems to be a problem with the automatically generated htaccess
    file.
    If I manually rewrite the link to point to page 2 of the post it is
    working:

    http://thevital.net/digitalcamera/index.php?category_name=uncategorized&name=nikon-coolpix-8800&page=2 (page=2 displays the correct second part of the
    post).

    As the permalink structure, I'm only using /%category%/%postname%/
    so nothing fancy.

    This is the htaccess line in question:
    RewriteRule ^(.+)/([^/]+)(/[0-9]+)?/?$ /digitalcamera/index.php?category_name=$1&name=$2&page=$3 [QSA,L]

    Is this a bug in the htaccess creation of WordPress?

    Thanks.

    Steve

  10. moshu
    Member
    Posted 8 years ago #

    As the permalink structure, I'm only using /%category%/%postname%/
    so nothing fancy.

    Just some quick notes:
    http://codex.wordpress.org/Using_Permalinks
    Read the Note on using %category% and
    Paged Navigation Doesn't Work sections.

  11. chemoul
    Member
    Posted 8 years ago #

    I've read this article before and I've read it again now, but I
    can't find anything in it the would relate/explain the problem I
    have?

    Steve

  12. moshu
    Member
    Posted 8 years ago #

    Because it says using the %category% might not work properly, depending on the server.

    The other section I referred to has some links to forum topics that seem to address the nextpage issues. Did you check those?

  13. chemoul
    Member
    Posted 8 years ago #

    I read the forum topics. It is clearly an issue with the htaccess
    rewrite rules. From what I could figure out, some of the rules are
    too greedy and match too much.

    Unfortunately, I'm not a regular expressions expert, so some help
    would really be appreciated.
    I tried replacing the .+ with [^/]+ in
    RewriteRule ^(.+)/([^/]+)(/[0-9]+)?/?$ /digitalcamera/index.php?category_name=$1&name=$2&page=$3 [QSA,L]
    so that only up until the next / would be matched and not the rest
    of the URL. This works for the nextpage part, but then clicking on
    an article title link does not work any more.

    Steve

Topic Closed

This topic has been closed to new replies.

About this Topic