Global Site Search breaks permalinks if category is used in permalink structure (3.1)

Hi there, I have been trying to track down a problem with my permalinks since updating WP. The problem occurs when Global Site Search (GSS) is active, and goes away when it is inactive.

My preferred permalink structure is: /%year%/%category%/%postname%/

When I use this permalink structure and GSS is active the following happens:
1. Home page displays fine - listing recent posts as usual.
2. Clicking any post delivers a 404 not found error.

If I disable GSS, everything works.
If I re-enable GSS, and remove %category% from my permalinks, everything works.

GSS is doing something that conflicts with standard rewrite rules.

I don't want to drop %category% from my permalinks because it will break any incoming links, and probably have big SEO implications. But I also want global site search to work.

Sorry about duplicate post. The is a problem with the forum. My first version had '%category%' in the title which was not handled correctly, making that post innaccessible. I suggest a moderator remove it. Also mention in the appropriate ear that forum title sanitization has a minor bug.
Kind regards,

  • Aphrodite

    Kevin, this is a general issue on 3.1 and some functions.

    BUT i confirm : global site search AND tags disabled, resave permalinks and hop ! IT WORKS !

    thanks kevin :slight_smile:


    Surprisingly, on another network of mine, with both global tags AND search active itworks just fine...

  • Ernie

    Hi Guys, I'm getting this same kind of error, and just downloaded the plugin several times, today.

    Even if I'm not using categories in the permalinks, whenever the search finds a post on the main blog, it inserts the uncategorized category, and uses that regardless of what the permalinks are set for.

    Right now, I've set the permalinks for "/%year%/%monthnum%/%postname%/" and no joy.

    Also, when the search returns more than a page of posts, the format of the page gets screwy...

    My site: and try a search for "physician" -- you'll see what happens. Using bp-social-child, but I'm guessing that the formatting is coming from the code that creates the table of posts -- it seems to me it's putting too many td's in some tr's.

  • Ernie

    I've just downloaded and installed the new update to v2.1 -- no joy.

    I don't see any change in the behavior of the plugin, at all.

    Any search I performed would find posts but it keeps producing links with "uncategorized" as a category -- which is firstly, incorrect, and secondly, not the right permalink format.

    Also, notice that when I click on such links, they windup at the NoAccess page...

    FYI -- here is all I have in my .htaccess file:

    RewriteEngine On
    RewriteBase /

    #uploaded files
    RewriteRule ^(.*/)?files/$ index.php [L]
    RewriteCond %{REQUEST_URI} !.*wp-content/plugins.*
    RewriteRule ^(.*/)?files/(.*) wp-includes/ms-files.php?file=$2 [L]
    RewriteRule ^(.*/)?avatar/(.*) wp-content/avatar.php?file=$2 [L]
    RewriteRule ^(.*/)?sitemap.xml wp-content/sitemap.php [L]

    # add a trailing slash to /wp-admin
    RewriteCond %{REQUEST_URI} ^.*/wp-admin$
    RewriteRule ^(.+)$ $1/ [R=301,L]

    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule . - [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-.*) $2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]

    AddHandler application/x-httpd-php5 .php

    <IfModule mod_security.c>
    <Files async-upload.php>
    SecFilterEngine Off
    SecFilterScanPOST Off

    Am I missing something?

    Meanwhile, I've had to revert to my original schema -- using /%category%/%post_title%/ for permalinks, and have disabled the plugin.

  • Mason

    Hiya Ernie,

    What version of WordPress are you running? I see some htaccess rules for some of our older plugins there. Specifically:
    RewriteRule ^(.*/)?avatar/(.*) wp-content/avatar.php?file=$2 [L]
    which isn't used by the latest versions of this plugin.

    As is mentioned above, it seems to work properly in some situations and not in others - making it a bit more difficult to track down. Still, let us know what version information for WordPress as well as other plugins you have running and we'll help track down the issue here.


Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.