Jump to content
mmm2

permalink url search

Recommended Posts

Va salut,

 

Rulez platforma wp cu o tema pro. Motorul meu de cautare nu imi afiseaza rezultatul cautarii in url. Ma poate ajuta si pe mine cineva sa repar acest bug!?  Cei de la tema nu vor sa imi ofere suport...

Multumesc

Edited by mmm2
Link to comment
Share on other sites

Exemplu

https://rstforums.com/forum/search 

 

si rezultatul dupa cautare

 

https://rstforums.com/forum/search/?q=test&quick=1

 

Link-ul meu nu se modifica. Ramane tot https://rstforums.com/forum/search  . Continutul il afiseaza !!! Ma intereseaza link-ul catre search-ul respectiv

Imi cer scuze de expliare... dar am preferat babeste sa fiu inteles.

Edited by mmm2
Link to comment
Share on other sites

Am citit cateva articole si am gasit urmatoarele coduri, dar nu stiu sigur daca functioneaza sau nu, dar pana iti ofera alta persoana care se pricepe, pot incerca aceasta varianta.

 

Prima incercare, se pune in functions.

 

function wpb_change_search_url() {
    if ( is_search() && ! empty( $_GET['s'] ) ) {
        wp_redirect( home_url( "/search/" ) . urlencode( get_query_var( 's' ) ) );
        exit();
    }
}
add_action( 'template_redirect', 'wpb_change_search_url' );

 

 

 

Daca nu functioneaza, incearca si asta, se pune in htaccess.

 

# Change WordPress search URL
RewriteCond %{QUERY_STRING} \?s=([^&]+) [NC]
RewriteRule ^$ /search/%1/? [NC,R,L]

  • Upvote 1
Link to comment
Share on other sites

1 minute ago, mmm2 said:

stiu ce spui... este setat /%postname%/ . nu e vorba de asta.... tu ai inteles din ce am explicat?

 

 

da, tu vrei  din curve.com/search sa iti  afisese in adress bar curve.com/dildo.sloboz.id=69.php

 

 

Link to comment
Share on other sites

RewriteCond %{QUERY_STRING} \\?s=([^&]+) [NC]
RewriteRule ^$ /%1/? [NC,R,L]

sau

function re_rewrite_rules() {
    global $wp_rewrite;
    // $wp_rewrite->author_base = $author_slug;
//  print_r($wp_rewrite);
//   $wp_rewrite->author_base        = 'autor';
   $wp_rewrite->search_base        = 'cevreacoaieleleletale';
//   $wp_rewrite->comments_base      = 'comentarios';
   $wp_rewrite->pagination_base    = 'pagina';
//   $wp_rewrite->flush_rules();
}
add_action('init', 're_rewrite_rules');

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...