[wp-hackers] Rewriting search URL

Mark Jaquith mark.wordpress at txfx.net
Sat Apr 23 23:46:10 GMT 2005


They are both WordPress functions.  wp_redirect() is 1.5.1, I think, so 
you'll need to upgrade to a recent nightly.

Peak Discharge wrote:

> Not working, I don't even know where get_bloginfo and wp_redirect come 
> from.
>
> On 4/22/05, *Mark Jaquith* <mark.wordpress at txfx.net 
> <mailto:mark.wordpress at txfx.net>> wrote:
>
>     Peak Discharge wrote:
>
>>     That changes my url into the form of
>>     http://www.unicorns.com/?s=string, which is a progress. The aim,
>>     however is to change all search urls to
>>     http://www.unicorns.com/search/string
>
>
>     How about this?  Seems to work for me.
>
>     <?php
>
>     if ($_REQUEST['s'] && strpos($_SERVER['REQUEST_URI'], '/search/')
>     === FALSE ) {
>     $redirect_to = get_bloginfo('home') . '/search/' . $_REQUEST['s'];
>     wp_redirect($redirect_to);
>     exit();
>     }
>
>     ?>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://comox.textdrive.com/pipermail/wp-hackers/attachments/20050423/96070e42/attachment-0001.html


More information about the wp-hackers mailing list