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.
10 Responses
Niklas
April 12th, 2008 at 6:55 am
1Thanks for this !! Solved my problems.
Nelson
April 12th, 2008 at 9:00 am
2Hi there Niklas, this is a a weird problem in wordpress. I’m glad it helped you to solve the problem.
greetings,
Nelson
Esmiz
April 15th, 2008 at 6:35 am
3Hi!
Thanks for posting the fix! However I think you have a typo in the code,
0 === strpos($structure, ‘%author%’) |
should be
0 === strpos($structure, ‘%author%’) ||
I tested it and worked for me.
Cheers,
Marcos
Qué Vida Esta » Blog Archive » Error 404 en Wordpress 2.5 para páginas estáticas
April 15th, 2008 at 7:13 am
4[...] probado varias cosas, pero la mejor solución la he encontrado en helpdeskgeek.com . Lo explica muy bien, pero he encontrado un pequeño fallo en el código, así que dejo por aquí [...]
Nelson
April 15th, 2008 at 3:34 pm
5Gracias for coming by Marcos. thanks for letting me know about the typo. I’m glad it helped you though.
regards,
Nelson
Bill Cecchini
April 20th, 2008 at 10:11 am
6Thank you, thank you, thank you!
cikgu azleen
April 22nd, 2008 at 10:30 am
7When I updated the permalinks, there is internal server error and I can reach my blog.. Why?
Nelson
April 22nd, 2008 at 8:12 pm
8Can you give more details cikgu.. if you lay out the problem in more details probably we can find a solution to your problem.
Nelson
cikgu azleen
April 25th, 2008 at 9:57 pm
9Sorry Nelson, I guess the problem does not lies in your fixing tips, but it occurs because of I changed the access of .htaccess file to 666. However, things are back to normal, and your fixing tips does work for me..
Thanks a lot!
Nelson
April 26th, 2008 at 9:40 am
10great Cikgu that you were able to fix the problem with your blog. messing around with .htaccess is not a good idea. I host this blog on a windows environment which does not have an .htaccess file. I’m glad you were able to figure out the problem though.
greets,
Nelson
Leave a reply
Categories
Recent Entries
Recent Comments
Most Commented
© 2007 Help Desk Geek Theme by: Design Disease