next_posts_link Templage Tag fails with .htaccess rewrite (5 posts)

  1. deko
    Posted 9 years ago #

    The template tags next_posts_link and previous_posts_link should work from the index.php template... BUT...

    If you are doing an .htaccess rewrite to arrive at your index.php, these tags will fail.

    The function responsible may be:

    get_pagenum_link() in template-function-links.php (at line 389).

    I noticed this line of code:

    $qstr = wp_specialchars($_SERVER['REQUEST_URI'])

    The value returned by this line is what appears to be buttering up the link that is returned by next_posts_link.

    For example, if your site is www.example.com, and you use htaccess to direct visitors to:

    (where wp-dir is wp install directory)

    the link returned by next_posts_link will look like this:


    Obviously this will return a 404 error -- so you will not be able to navigate through your posts.

    I discovered this problem recently and am still looking for a solution.

  2. deko
    Posted 9 years ago #

    Is anyone familiar with that get_pagenum_link() function?

    I miss my next_posts_link Template Tag...

  3. deko
    Posted 9 years ago #

    There must be some way to hardcode the correct path rather than using the return value of the function.

    Any suggestions on how to do this?

  4. BlogMasterG
    Posted 8 years ago #

    I'm having a similar issue, and it sounds like it could be related to this.

    I'm running WP 2.1 on Win2003/IIS 6. If you use the previous/next links (next_posts_link / previous_posts_link) at the bottom of my category pages - like this:


    ...index.php is added directly after /blog when it should be implicit at the end of the URL:


    deko- Did you ever resolve this issue?

  5. tyleroakleaf
    Posted 8 years ago #

    I'm also very interested, as I have the exact some problem.

Topic Closed

This topic has been closed to new replies.

About this Topic