How can i move search results onto a specific page?

I was wondering if it is possible to have the wordpress search results displayed on a different page?

At the moment they are displayed on http://www.mysite.com/?s=searchterm but I would like them displayed on my search-results template page, so http://www.mysite.com/search/?s=searchterm.

Is this possible?

Any help greatly appreciated, S.

4 s
4

You created a page with the slug search to “capture” that URL, but WordPress by default already uses that URL for search results. So you were “lucky” that this worked for you, and this is the reason the redirect supermethod mentioned will work.

So, instead of creating a “fake” page to hold the template, you should just rename the template to search.php, like tnorthcutt suggested. If you still want to have content from the page defined in the admin area, I suggest you rename this page and get it via get_posts() or another method, because the main loop will contain search results, not this specific page.

Leave a Comment