Forums

[resolved] Permalink randomly redirects to page_id=x (5 posts)

  1. Brad Williams
    Member
    Posted 3 years ago #

    I have a very strange problem that I can't seem to find an answer to. I have a site running WP 2.7 that I just setup permalinks on. Everything is working great, but randomly when you click on a URL (which is now the permalink) it will redirect to a page like this:

    http://www.domain.com/?page_id=9

    Which throws this error:
    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 7 on line: 1001

    Now this doesn't happen every time you click on the URL. Sometimes it will load the correct permalink and other times it will forward to the page_id URL, which is wrong.

    I verified .htaccess file is correct like so:
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    # END WordPress

    Any ideas on what could be causing this? It's very random and I can't seem to pinpoint the issue.

    Thanks in advance

  2. Brad Williams
    Member
    Posted 3 years ago #

    Another little nugget I discovered is anytime this happens the HTTP response is: HTTP/1.1 302 Moved Temporarily

    Why in the world would it redirect using a 302 temporary redirect to the wrong URL? Very strange.

  3. kristopher.ives
    Member
    Posted 3 years ago #

    In my .htaccess I disable MutiView which may be causing this issue. This article describes how they work and why they might be causing the issue:

    http://www.gerd-riesselmann.net/archives/2005/04/beware-of-apaches-multiviews

    I also wrote about this when I enabled permalinks on a GoDaddy account: http://santiance.com/kris/2009/permalinks-on-godaddy/

  4. Brad Williams
    Member
    Posted 3 years ago #

    Thanks for the suggestion, but that didn't work. You know what's weird is it seems to happen in certain browsers every time. I'm testing in Google Chrome and every time I test it I am forwarded to the wrong URL, but in FF3 I am not.

    This keeps getting weirder

  5. Brad Williams
    Member
    Posted 3 years ago #

    Ok I figured out what was causing this. My client had a plugin installed called WishList Member, which had that URL saved as a setting if you were not authorized to view a page, or in this case a category.

    Moral of the problem: Check plugins first!

Topic Closed

This topic has been closed to new replies.

About this Topic