Previous and next link
-
I added the following code to the index.php page: <div class=”navigation”><p><?php posts_nav_link(); ?></p></div> but there is something wrong with the link that appears: http://www.english-channel.org/index.php/Index.php/page/2
To work fine, the link should be this one when I click on “Next page”: http://www.english-channel.org/index.php/page/2
Could you please tell me how to remove the “Index.php” part?Thanks in advance for your help!
-
(nothing)
You are using pretty permalinks on a IIS server, a recipe for pretty permalinks issues. I’d recommend updating to 2.6.1 and checking out:
Permalinks without mod_rewrite
You may have an unneeded index.php in your settings somewhere if you are getting two of them.
Fix: paging in WordPress under IIS
For the last few minutes, I have been trying to figure out why next_posts_link() did not work on a template for a clients’ blog, under IIS.
I found a great tip, but I prefer standard functions over things that work.
Then I found out under IIS, PHP returns a wrong value for $_SERVER[“REQUEST_URI”]. The link to the previous page was index.php/Index.php/page/2/. Notice there are two “index.php” (for Windows, index and Index are just the same.)
The real, working, clean and easy solution is to add a simple line of code in the clean_url() function in wp-includes/formatting.php:
$url = str_replace('index.php/Index.php','index.php',$url);
just put this at the beginning of the function before any “if Statements” only thing is you have to remember to do this again if you upgrade word press.
Hope this helps you out.
My Site http://blog.ebookzones.com you will see my PageNav now works great.
Donbert
- The topic ‘Previous and next link’ is closed to new replies.