Title: Redirection based on search parameter
Last modified: June 23, 2023

---

# Redirection based on search parameter

 *  Resolved [jordyblanken](https://wordpress.org/support/users/jordyblanken/)
 * (@jordyblanken)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/redirection-based-on-search-parameter/)
 * Hi,
 * Is it possible to create a redirect based on a website search?
   What I want is
   actually: If [https://URL.TLD/?s=star+wars](https://URL.TLD/?s=star+wars) contains
   the words star or wars, redirect to this page: [REDIRECT]Is this possible en 
   how can we achieve this?

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Plugin Author [John Godley](https://wordpress.org/support/users/johnny5/)
 * (@johnny5)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/redirection-based-on-search-parameter/#post-16842776)
 * Source: `[/?s=star+wars](https://url.tld/?s=star+wars) `
 * Target: `[REDIRECT]`
 *  Thread Starter [jordyblanken](https://wordpress.org/support/users/jordyblanken/)
 * (@jordyblanken)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/redirection-based-on-search-parameter/#post-16842994)
 * Super. But in that case, if the customer searches for Star Wars duvets. That 
   it refers to a different category? That he really looks at words contains and
   not at url.
 *  Plugin Author [John Godley](https://wordpress.org/support/users/johnny5/)
 * (@johnny5)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/redirection-based-on-search-parameter/#post-16843031)
 * I don’t know what you mean by that?
 *  Thread Starter [jordyblanken](https://wordpress.org/support/users/jordyblanken/)
 * (@jordyblanken)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/redirection-based-on-search-parameter/#post-16843110)
 * Sorry, let me describe it more clearly.
   What we want to achieve is that when 
   someone searches for a certain product category, they will be automatically redirected
   to the category page. Now our search parameter is: _?s=_, so what I really want
   is to set it up to do the following. If the url contains ?s= and for example 
   Star Wars (somewhere in the url, the search query of the visitor), redirect the
   user to [THIS] page.I hope my explanation is clear and I hope this is possible
   with your plugin. Anyway, you’ve done a great job!
 *  Plugin Author [John Godley](https://wordpress.org/support/users/johnny5/)
 * (@johnny5)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/redirection-based-on-search-parameter/#post-16843158)
 * Doesn’t my suggestion do that? If you need other search terms then you will need
   to create a redirect for each one.
 *  Thread Starter [jordyblanken](https://wordpress.org/support/users/jordyblanken/)
 * (@jordyblanken)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/redirection-based-on-search-parameter/#post-16843164)
 * But your suggestion doesn’t work in the way that they should search for the specific
   search item? So you can’t move words in the search term?
 *  Plugin Author [John Godley](https://wordpress.org/support/users/johnny5/)
 * (@johnny5)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/redirection-based-on-search-parameter/#post-16843173)
 * Sorry, I’m really not understanding. You asked for a redirect for `/?s=star+wars`.
   Do you mean that it should match any search containing ‘star wars’? If you can
   create a regular expression to match then you can use that:
 * [https://redirection.me/support/redirect-regular-expressions/](https://redirection.me/support/redirect-regular-expressions/)

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Redirection based on search parameter’ is closed to new replies.

 * ![](https://ps.w.org/redirection/assets/icon-256x256.jpg?rev=983639)
 * [Redirection](https://wordpress.org/plugins/redirection/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/redirection/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/redirection/)
 * [Active Topics](https://wordpress.org/support/plugin/redirection/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/redirection/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/redirection/reviews/)

 * 7 replies
 * 2 participants
 * Last reply from: [John Godley](https://wordpress.org/support/users/johnny5/)
 * Last activity: [2 years, 11 months ago](https://wordpress.org/support/topic/redirection-based-on-search-parameter/#post-16843173)
 * Status: resolved