Search Widget and WWW Prefix
September 28, 2007
Prior to WordPress 2.3, yourblogname and www.yourblogname were two different animals. I’m still living in the pre-2.3 world (until EventCalendar3 is updated) so I was playing around with the stock search widget on my blog. I don’t use the www prefix anywhere on it but for some reason, when I used the default search widget, my search results came back with the www prefix attached. I scanned my database for a rogue www entry and never found it.
The problem was in the widget.php file. In Line 409, the script will return the bloginfo url for the search function with a minor problem. It leaves out the trailing slash on the bloginfo url (at least on my blog) and forces a redirect the way my .htaccess is set up to the www prefix. I added a slash after the call to bloginfo url and now I’m not redirected. No more head scratching (at least for this issue).
Entry Filed under: WordPress. Tags: widget, canonical, redirect, search.

Leave a Comment
Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
Trackback this post | Subscribe to the comments via RSS Feed