WordPress.org

Support

Support » How-To and Troubleshooting » /search/keyword instead of /?s=keyword

/search/keyword instead of /?s=keyword

  • if i surf to my site/search/keyword i get the searchresults for ‘keyword’ so that works perfectly

    but when i use the searchbox on my WP site then it also shows me the searchresults page but with the url site/?s=keyword

    and that doesnt look so nice, also in Google analytics is nice to be able to look at all the keywords users searched at using the content drilldown option for all ‘pages’ under /search/

    so i wonder if its possible to easily change the search option to use the nice url mapping instead of the querystring version

Viewing 2 replies - 1 through 2 (of 2 total)
  • i created a dummy search page that takes the post variable and creates the right link, now i get the nice /search/keyword urls in my google analytics

    <?php
    $searchterm = $_POST[“s”];
    $searchurl = “/search/”;
    $redirecturl = $searchurl . $searchterm;
    header(“Location: ” . $redirecturl);
    ?>

    Hi, could you please specify where do you place this code?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘/search/keyword instead of /?s=keyword’ is closed to new replies.
Skip to toolbar