Forums

customise the search_base (prefix) ?? (9 posts)

  1. _erik_
    Member
    Posted 6 years ago #

    hi all! :)

    i'm using the great plugin "nice search" to redirect the clean url

    http://www.domain.de/wp-dir/search/term+anotherterm

    to the wp default

    http://www.domain.de/wp-dir/?s=term%20anotherterm

    what works just fine for me now without any big efforts...
    ... how do change the word "search" into something different (E.g the german "suche" or "results")?
    i found quite a few appearences both in the database (rewrite_rules) and in functions and classes.php files.
    mod_rewriting doesn't seem to work as expected - think its all redirected to index.php, right?
    whats the right place to change this search-prefix?
    (in order to get something like
    http://www.domain.de/suche/term1+term2)
    thanks in advance!

  2. devilmaycry
    Member
    Posted 6 years ago #

    Search for this in your nice-search.php file:

    if ( is_search() && strpos($_SERVER['REQUEST_URI'], '/wp-admin/') === false && strpos($_SERVER['REQUEST_URI'], '/search/') === false ) {
    wp_redirect(get_bloginfo('home') . '/search/' . str_replace(' ', '+', str_replace('%20', '+', get_query_var('s'))));

    Replace with this:

    if ( is_search() && strpos($_SERVER['REQUEST_URI'], '/wp-admin/') === false && strpos($_SERVER['REQUEST_URI'], 'suche/') === false ) {
    wp_redirect(get_bloginfo('home') . '/suche/' . str_replace(' ', '+', str_replace('%20', '+', get_query_var('s'))));

  3. _erik_
    Member
    Posted 6 years ago #

    doesn't work -> returns a 404 (well, this would have been too easy - furthermore i already tried that version!)

    did i mention that wp2.02 seems to have the word 'search' deeply in its code? it doesn't make any sense to me (as every visitor just sees ?s=blabla per default) but thats what my problem is. redirecting dont work (neither the way you mentioned nor via mod_rewrite nor via a separate search.php (sending headers) as mentioned elsewhere in this forum.

    *sad* :-(

    (edit) it seems wordpress needs the word "search" to recognize a request being a search... but where exactly can i influence this hardcoded wp-inconsequency? imho it would be clever to have a seperate field for this setting in the permalink-section. (/edit)

  4. _erik_
    Member
    Posted 6 years ago #

    ok, whats up? silly explained, or also too stupid for such mods? :-D

  5. _erik_
    Member
    Posted 6 years ago #

    no replies since? if this little piece of mod can be done with lightpress -> should be possible with wp, no?

  6. Chris_K
    Member
    Posted 6 years ago #

    Out of curiosity, are you running the english version of WP or another language? ( WP in other languages)

    Have you contacted the plugin author to see if he has i18n support?

  7. _erik_
    Member
    Posted 6 years ago #

    well, im running wp localised in german with a language file (de_DE.mo). anyway: this language-file has no effect on wp's search. by default, search results are seen on a site with the following url:
    http://www.domain.tld/wordpress/?s=searchterm
    right?
    i dont see what a language-file should translate here.

    even the plugin "nice search" or the instructions from the codex (that tell to create a search.php in /wordpress/ that sends a new header to /wordpress/search/searchterm) cant be customised, because simply translating the word search to my desired "suche" causes a 404-error.
    again: translating the "normal" way or with poedit doesn't work here.
    i dont understand why wordpress internally accepts /search/ but /suche/ causes a 404...

    no ideas on fixing this localised url's wordpress is persisting on?

    again: my problem is not to localise a theme or plugin, my problem is wordpress being pre-localised... :(

    kindly

  8. _erik_
    Member
    Posted 6 years ago #

    • up! •

  9. _erik_
    Member
    Posted 6 years ago #

    arghhh...

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.