How to fix wordpress blog sudden redirection to present post problem

Wednesday, 22nd December 2010

My blog’s index has suddenly started redirecting to my last post. That was rather strange, since I haven’t done anything special, all I did before the problem occured was a change in wordpress wp-admin to my latest post.

There in I changed the post Visibility from Public to Private

Right after this my blog’s home started redirecting to the blog post where the changes was made.

This was really strange, so I reverted back the changes in Post’s Publish Visibility to the default setting.
Though the change the redirect to the latest post by accessing my www.pc-freak.net/blog/ was still there.

I tried completely wiping out the post by sending it to Trash and issuing the same post again, but now things became even worser.

Accessing my blog was opening 404 not found error message . Everything seemed fine in wordpress admin and therefore I suspected the redirect is being applied from info read in my wordpress database in MySQL.

A bit of investigation prooved my guess was correct, for some reason a record was made to the MySQL blog database in table wp_redirection_items.

The incorrect redirection wihtin the database looked like so:

| 4 | /blog/ | 0 | 2 | 0 | 0000-00-00 00:00:00 | 2 | enabled | url | 301 | /blog/how-to-change-from-default-main-menu-to-other-text-in-joomla/ | url | NULL |

Removing the incorrect redirect was kind of easy and came to simply issuing:

mysql> delete from wp_redirection_items where id='3';
Query OK, 1 row affected (0.00 sec)

This fixed the redirection issue and opening my blog main page started correctly opening the main page again! 🙂

Share this on:

Download PDFDownload PDF

Tags: , , , , , , , , , , , , , , , , , , , , , , , , , ,

3 Responses to “How to fix wordpress blog sudden redirection to present post problem”

  1. Luke says:
    Firefox 3.6.13 Firefox 3.6.13 Ubuntu 10.10 x64 Ubuntu 10.10 x64
    Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101206 Ubuntu/10.10 (maverick) Firefox/3.6.13

    A client had this same redirect problem, and I was able to fix it very quickly by getting clued in to wp_redirection_items via your post. Thanks a lot. 🙂

    View CommentView Comment
  2. Leo says:
    Google Chrome 8.0.552.224 Google Chrome 8.0.552.224 Windows 7 Windows 7
    Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.10 (KHTML, like Gecko) Chrome/8.0.552.224 Safari/534.10

    Same issue affected a site of mine.

    Clean the wp_redirection_items worked 🙂

    Thanks

    View CommentView Comment
  3. admin says:
    Firefox 3.6 Firefox 3.6 Windows XP Windows XP
    Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6

    I have once again came across the same redirection issue with wordpress, whether my wordpress index.php was redirecting to the last article in my blog by default. Now this time the explained methods in my article doesn’t works.
    This time to solve this annoying wordpress bug it was necessary to modify records in the table:
    wp_redirection_groups.

    I have a field there with the following records:
    id |name | tracking | module_id status | position records
    2 | Modified | posts | 1 | 1 | enabled |1

    The column that says enabled needs to be turned to disabled to resolve the issue.

    Here is the commands to solve the situation in case if the other suggestion in this article doesn’t help:

    mysql> use blog;
    mysql> update wp_redirection_groups set status=’disabled’ where name=’Modified Posts’;
    Query OK, 0 rows affected (0.00 sec)
    Rows matched: 1 Changed: 0 Warnings: 0

    Query OK, 1 row affected (0.00 sec)

    Another possible way to resolve the issue without mysql cli interface is straight via phpmyadmin.

    View CommentView Comment

Leave a Reply

CommentLuv badge