Some searches have one obvious answer: a shopper searching for “shipping costs” wants the shipping information page, a search for a brand should open the brand’s category, and a search for a campaign name should land on the campaign page. Instead of showing a product search result, this module redirects such searches directly to the page you define.
Features
- Define search terms per store view that redirect to a page of your choice instead of showing search results.
- Four matching modes:
- “Equals”: the search must match the term exactly.
- “Part Of”: the term may appear anywhere in the search.
- “All Words”: every word of the term must appear in the search, in any order.
- “Any Word”: one matching word is enough.
- An asterisk in a term works as a wildcard for any letters or digits, for example “shirt*” also matches “shirts”.
- Matching can be case sensitive or case insensitive.
- The target can be a full web address (also on another website) or a path within the store, for example a CMS page or category.
- Terms are checked in the order of their position; the first matching active term wins.
- Terms can be deactivated without deleting them.
- Redirected searches still count towards the search term statistics.
Configuration
Manage the terms under Infrangible > Search Redirect > Terms in the admin. The grid lists all terms and allows adding, editing and deleting them (also several at once). For each term you set:
- “Term”: the text to match, optionally with ”*” wildcards
- “Store View”: where the term applies
- “Mode”: Equals, Part Of, All Words or Any Word
- “Case Sensitive”: Yes or No
- “Redirect Url”: the target page
- “Position”: the order in which terms are checked
- “Active”: whether the term is used
Good to know
Redirects are checked before the search is executed, so a matching search never shows a result page. Use the “Equals” mode for short terms to avoid redirecting searches that only contain the term by chance.
Installation
Install the module with Composer in your Magento root directory:
composer require infrangible/m2-catalog-search-redirectThen enable it and update the store as described in the installation guide. Composer installs the required modules listed on this page automatically.