A couple weeks ago I decided to upgrade this blog to the newly released version of wordpress 2.5. As I normally do when doing an upgrade, I created a buck-up of all the posts, and disabled all the plugins, and started doing the upgrade. Everything went fine, until I tried to open a page on the menu bar, I had a message saying that the page I was looking for was not found. I checked the pages in the back-end to make sure they were there, and they were there as before, but the freaking pages were not loading now. I started doing research on the problem, and I found out I was not alone; many people were having the same problem with the upgrade. And there was no solution to the problem, so I left the problem for later. Today I did a research and found this solution to the problem in a wordpress forum which I don’t remember now; if you want to take credit to the solution please post a comment and the link to the solution page.

If you are running your blog in IIS and have a permalink like /index.php/%postname% to fix the problem open the rewrite.php file under /wp-includes/ and look for code:

if ( 0 === strpos($structure, ‘%postname%’) ||
0 === strpos($structure, ‘%category%’) ||
0 === strpos($structure, ‘%tag%’) ||
0 === strpos($structure, ‘%author%’) )
$this->use_verbose_page_rules = true;

And change it for:

if ( 0 === strpos($structure, ‘%postname%’) ||
0 === strpos($structure, ‘%category%’) ||
0 === strpos($structure, ‘%tag%’) ||
0 === strpos($structure, ‘%author%’) ||
$this->using_index_permalinks() )
$this->use_verbose_page_rules = true;

Notice that the only change in the second code is $this->using_index_permalinks() ) after you make this change in the rewrite.php file, change your permalink setting to “Default” in your wordpress settings, change back to whatever you want, this will force wordpress to rewrite the links. Now you should be able to open the pages.

Link back to this blog if you fine this post useful, it could be a good way to say Thank you.