Tag Archives: htaccess_file

OpenSearch RSS AutoDiscovery for WordPress Searches

I started to compile a “wish list” of WordPress plugins. Turns out, many of my wishes have already come true – it just took a little digging on Google. Too bad there’s not an amazingly comprehensive WordPress plugin directory / wiki (and if there is, nobody really knows about it yet). One of my wishes was for an OpenSearch feed. Turns out Williamsburger already created a plugin, with a WP 2.0 compatible version linked from his comments thread. This got me up and running with my own OpenSearch feed easily enough, but I wanted to have it actually be autodiscoverable within a search query. Without bothering anybody in my personal circle, I found the variables I needed to insert between at the top of my header.php template:

[php]< ?php if (is_search()) { ?>
< link rel="alternate" type="application/rss+xml" title=": < ?=wp_specialchars($s); ?>” href=”http://chris.pirillo.com/os-query?s=< ?=wp_specialchars($s); ?>” />
< ?php } ?>[/php]There you go. An autodiscoverable feed for your WordPress searches! Try a search on my blog for a living example. Couldn’t have gotten it done unless Shayne figured out what I was doing wrong within the .htaccess file. Ugh. I’ve gotta start learning more about Regular Expressions. FUN!

From BlogWare to WordPress – Part Deux

Getting the code out of BlogWare and into WordPress was one thing. Getting everything else to work well has been something of a task. All my old URLs didn’t have any helpful keywords in them, so the 404 redirect script I found wasn’t working as effectively as it might have. Shayne pointed out that both the old URLs and new URLs have date information in them, so it would just take a little scripting before things would work easier for all those search engine visitors. I’ve got a new Google Sitemap submitted, FWIW.

I remembered the WP-Hackers, which we used to develop a Gada.be plugin – both standalone, and for the amazingly awesome Ultimate Tag Warrior. I posted my request, and received several satisfactory answers. Mark Jaquith responded with a single line of code that needed to be placed at the top of the .htaccess file. Easy. Done. Awesome.