Would it be possible to configure the search404 "Jump directly to the first search result" feature to only happen if the search query contains certain words?

For instance,

1. website.com/2010/14/best-blog-post (does not exist)
2. website.com/best-blog-post (does not exist either)

I would want any paths that start with YYYY/MM (regex) to jump directly to the first match ("Jump directly to the first search result" option), but have everything else return a list of matches, as if I hadn't checked the option, "Jump directly to the first search result" in the search404 configuration.

Maybe there is some custom PHP that will conditionally trigger this option, but otherwise respect the default settings?

Comments

arjun_sreekumar’s picture

Assigned: Unassigned » arjun_sreekumar
Status: Active » Needs work
arjun_sreekumar’s picture

Status: Needs work » Needs review
StatusFileSize
new2.55 KB
anish.a’s picture

Status: Needs review » Reviewed & tested by the community

Looks fine.

anish.a’s picture

Status: Reviewed & tested by the community » Closed (fixed)

amaisano’s picture

Wow, thank you!

anish_zyxware’s picture