The MU forums have moved to WordPress.org

Rewriting search result URLs (10 posts)

  1. Miroslav
    Member
    Posted 15 years ago #

    I would like to be able to link to search result pages with 'pretty' URLs.

    So, instead of:
    http://www.example.com/?s=search+term

    I would like:
    http://www.example.com/s/search+term

    What would the rewrite rule look like in the .htaccess file?

    Note: I am using Donncha's domain mapping plugin for WPMU and the blogs are installed in the root.

    Thank you! :)

  2. Miroslav
    Member
    Posted 15 years ago #

    Also, is there any way to rewrite the "+" in multi-word phrases to something more 'normal' (say, underscore "_")?

    (Sorry for bumping. Forgot to ask in my original post.)

  3. Ovidiu
    Member
    Posted 15 years ago #

    as far as I know this ancient plugin still works: http://txfx.net/code/wordpress/nice-search/ give it a try, otherwise, you might get some ideas by looking at the code

  4. Miroslav
    Member
    Posted 15 years ago #

    Brilliant, Ovidiu! Thanks! Hope it won't conflict with my other search plugins (Search Excerpt and Search Reloaded). Will take it for a ride and report back.

  5. Miroslav
    Member
    Posted 15 years ago #

    Reporting back... the Nice Search pluginm mentioned by Ovidiu above, works like a charm. Exactly what I needed. Thanks, Ovidiu!

  6. tdjcbe
    Member
    Posted 15 years ago #

    First I knew about this plugin. Thanks for this as well.

  7. Klark0
    Member
    Posted 15 years ago #

    Default Wordpress Search really sucks. When are they gonna fix it without use having us use 2-3 plugins to have it run correctly?

  8. tdjcbe
    Member
    Posted 15 years ago #

    Open up a trac ticket. I'm sure they'll love you for it if you word it like that. :)

  9. PandeBCN
    Member
    Posted 15 years ago #

    I use Nice Search, is good, but I think it does a 302 redirection. I would like a 301.
    What can I do?

  10. Markus Steiner
    Member
    Posted 15 years ago #

    Maybe something like that in your .htaccess might help:

    RewriteEngine on
    RewriteRule ^seite_([0-9]+).html$ seite.php?id=$1

About this Topic

  • Started 15 years ago by Miroslav
  • Latest reply from Markus Steiner