Redirect modern search page to classic search center page in SharePoint 2019

%3CP%3E%3C%2FP%3E%3CP%3E%3CSERVERVARIABLES%3E%3C%2FSERVERVARIABLES%3E%3C%2FP%3E%3CP%3E%3CSET%20name%3D%22%26quot%3BQUERY_STRING_A%26quot%3B%22%20value%3D%22%26quot%3B%7BC%3A2%7D%26quot%3B%22%3E%3C%2FSET%3E%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%20data-unlink%3D%22true%22%3E%3CACTION%20type%3D%22%26quot%3BRedirect%26quot%3B%22%20url%3D%22%26quot%3Bhttp%3A%2F%2FSharePoint%2Fsites%2Fsearch%2FPages%2Fresults.aspx%3Fk%3D%7BQUERY_STRING_A%7D%26quot%3B%22%20appendquerystring%3D%22%26quot%3Bfalse%26quot%3B%22%20redirecttype%3D%22%26quot%3BFound%26quot%3B%22%3E%3C%2FACTION%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENote%3A%20Please%20consider%20configuring%20URL%20rewrites%20using%20below%20article%20whether%20its%20supported%20or%20not%20by%20Microsoft.%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fsupport.microsoft.com%2Fen-us%2Foffice%2Fsupportability-of-rewrites-and-redirects-in-sharepoint-2016-2013-2010-and-2007-a74a19f2-a59a-4b39-8be4-ce63e50139fa%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fsupport.microsoft.com%2Fen-us%2Foffice%2Fsupportability-of-rewrites-and-redirects-in-sharepoint-2016-2013-2010-and-2007-a74a19f2-a59a-4b39-8be4-ce63e50139fa%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%3CSERVERVARIABLES%3E%3C%2FSERVERVARIABLES%3E%3C%2FP%3E%3CP%3E%3CSET%20name%3D%22%26quot%3BQUERY_STRING_A%26quot%3B%22%20value%3D%22%26quot%3B%7BC%3A2%7D%26quot%3B%22%3E%3C%2FSET%3E%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%20data-unlink%3D%22true%22%3E%3CACTION%20type%3D%22%26quot%3BRedirect%26quot%3B%22%20url%3D%22%26quot%3Bhttp%3A%2F%2FSharePoint%2Fsites%2Fsearch%2FPages%2Fresults.aspx%3Fk%3D%7BQUERY_STRING_A%7D%26quot%3B%22%20appendquerystring%3D%22%26quot%3Bfalse%26quot%3B%22%20redirecttype%3D%22%26quot%3BFound%26quot%3B%22%3E%3C%2FACTION%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENote%3A%20Please%20consider%20configuring%20URL%20rewrites%20using%20below%20article%20whether%20its%20supported%20or%20not%20by%20Microsoft.%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fsupport.microsoft.com%2Fen-us%2Foffice%2Fsupportability-of-rewrites-and-redirects-in-sharepoint-2016-2013-2010-and-2007-a74a19f2-a59a-4b39-8be4-ce63e50139fa%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fsupport.microsoft.com%2Fen-us%2Foffice%2Fsupportability-of-rewrites-and-redirects-in-sharepoint-2016-2013-2010-and-2007-a74a19f2-a59a-4b39-8be4-ce63e50139fa%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2680497%22%20slang%3D%22en-US%22%3ERedirect%20modern%20search%20page%20to%20classic%20search%20center%20page%20in%20SharePoint%202019%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2680497%22%20slang%3D%22en-US%22%3E%3CP%3E%3CU%3E%3CSTRONG%3EScenario%3A%3CBR%20%2F%3E%3C%2FSTRONG%3E%3C%2FU%3EConsider%20you%20have%20a%20modern%20communication%20site%20in%20SP2019%20where%20users%20perform%20search.%20Search%20query%20redirects%20to%20the%20modern%20search%20page%20whose%20look%20and%20feel%20is%20not%20the%20same%20as%20classic%20search%20page.%20Few%20users%20may%20not%20like%20the%20new%20look%20and%20feel.%3C%2FP%3E%3CP%3EYou%20are%20looking%20for%20ways%20to%20customize%20this%20new%20look%20and%20feel%20for%20modern%20search%20page.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CU%3E%3CSTRONG%3ECause%3A%26nbsp%3B%3C%2FSTRONG%3E%3C%2FU%3E%3C%2FP%3E%3CP%3EThis%20is%20a%20by%20design%20behavior%20as%20you%20cannot%20customize%20the%20modern%20search%20page%20for%20modern%20sites%20in%20SharePoint%202019.%26nbsp%3B%3C%2FP%3E%3CP%3ERefer%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fsharepoint%2Fsearch%2Fdifferences-search-2016-2019%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fsharepoint%2Fsearch%2Fdifferences-search-2016-2019%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CU%3E%3CSTRONG%3EWorkaround%3A%3C%2FSTRONG%3E%3C%2FU%3E%3C%2FP%3E%3CP%3EConsider%20you%20have%20a%20classic%20search%20center%20site%20collection%20and%20are%20exploring%20options%20to%20redirect%20the%20search%20request%20from%20this%20modern%20search%20page%20to%20the%20classic%20search%20page.%20You%20can%20use%20below%20redirection%20using%20URL%20rewrite%20tool%20in%20IIS%20to%20achieve%20the%20goal.%3C%2FP%3E%3CP%3EModern%20Search%20page%3A%20%3CA%20href%3D%22http%3A%2F%2FSharepoint%2F_layouts%2F15%2Fsearch.aspx%2Fsitefiles%3Fq%3Ddocument%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Ehttp%3A%2F%2FSharepoint%2F_layouts%2F15%2Fsearch.aspx%2Fsitefiles%3Fq%3Ddocument%3C%2FA%3E%3C%2FP%3E%3CP%3EClassic%20search%20page%3A%20%3CA%20href%3D%22http%3A%2F%2Fsharepoint%2Fsites%2Fsearch%2FPages%2Fresults.aspx%3Fk%3Ddocument%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Ehttp%3A%2F%2Fsharepoint%2Fsites%2Fsearch%2FPages%2Fresults.aspx%3Fk%3Ddocument%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CREWRITE%3E%3C%2FREWRITE%3E%3C%2FP%3E%3CP%3E%3CRULES%3E%3C%2FRULES%3E%3C%2FP%3E%3CP%3E%3CCLEAR%3E%3C%2FCLEAR%3E%3C%2FP%3E%3CP%3E%3CRULE%20name%3D%22%26quot%3BModern%22%20to%3D%22%22%20classic%3D%22%22%3E%3C%2FRULE%3E%3C%2FP%3E%3CP%3E%3CMATCH%20url%3D%22%26quot%3B*_layouts%2F15%2Fsearch.aspx*%26quot%3B%22%3E%3C%2FMATCH%3E%3C%2FP%3E%3CP%3E%3CCONDITIONS%20logicalgrouping%3D%22%26quot%3BMatchAll%26quot%3B%22%20trackallcaptures%3D%22%26quot%3Btrue%26quot%3B%22%3E%3C%2FCONDITIONS%3E%3C%2FP%3E%3CP%3E%3CADD%20input%3D%22%26quot%3B%7BQUERY_STRING%7D%26quot%3B%22%20pattern%3D%22%26quot%3B*q%3D*%26quot%3B%22%3E%3C%2FADD%3E%3C%2FP%3E%3CP%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CP%3E%3C%2FP%3E%3CP%3E%3CSERVERVARIABLES%3E%3C%2FSERVERVARIABLES%3E%3C%2FP%3E%3CP%3E%3CSET%20name%3D%22%26quot%3BQUERY_STRING_A%26quot%3B%22%20value%3D%22%26quot%3B%7BC%3A2%7D%26quot%3B%22%3E%3C%2FSET%3E%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%20data-unlink%3D%22true%22%3E%3CACTION%20type%3D%22%26quot%3BRedirect%26quot%3B%22%20url%3D%22%26quot%3Bhttp%3A%2F%2FSharePoint%2Fsites%2Fsearch%2FPages%2Fresults.aspx%3Fk%3D%7BQUERY_STRING_A%7D%26quot%3B%22%20appendquerystring%3D%22%26quot%3Bfalse%26quot%3B%22%20redirecttype%3D%22%26quot%3BFound%26quot%3B%22%3E%3C%2FACTION%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENote%3A%20Please%20consider%20configuring%20URL%20rewrites%20using%20below%20article%20whether%20its%20supported%20or%20not%20by%20Microsoft.%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fsupport.microsoft.com%2Fen-us%2Foffice%2Fsupportability-of-rewrites-and-redirects-in-sharepoint-2016-2013-2010-and-2007-a74a19f2-a59a-4b39-8be4-ce63e50139fa%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fsupport.microsoft.com%2Fen-us%2Foffice%2Fsupportability-of-rewrites-and-redirects-in-sharepoint-2016-2013-2010-and-2007-a74a19f2-a59a-4b39-8be4-ce63e50139fa%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2680497%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ESearch%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%20Server%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%20Server%202016%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%20Server%202019%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%20Server%202019%20modern%20experience%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
New Contributor

Scenario:
Consider you have a modern communication site in SP2019 where users perform search. Search query redirects to the modern search page whose look and feel is not the same as classic search page. Few users may not like the new look and feel.

You are looking for ways to customize this new look and feel for modern search page.

 

Cause: 

This is a by design behavior as you cannot customize the modern search page for modern sites in SharePoint 2019. 

Refer: https://docs.microsoft.com/en-us/sharepoint/search/differences-search-2016-2019 

 

Workaround:

Consider you have a classic search center site collection and are exploring options to redirect the search request from this modern search page to the classic search page. You can use below redirection using URL rewrite tool in IIS to achieve the goal.

Modern Search page: http://Sharepoint/_layouts/15/search.aspx/sitefiles?q=document

Classic search page: http://sharepoint/sites/search/Pages/results.aspx?k=document

 

<rewrite>

<rules>

<clear />

<rule name="Modern to Classic" enabled="true" patternSyntax="Wildcard" stopProcessing="true">

<match url="*_layouts/15/search.aspx*" />

<conditions logicalGrouping="MatchAll" trackAllCaptures="true">

<add input="{QUERY_STRING}" pattern="*q=*" />

</conditions>

<serverVariables>

<set name="QUERY_STRING_A" value="{C:2}" />

</serverVariables>

<action type="Redirect" url="http://SharePoint/sites/search/Pages/results.aspx?k={QUERY_STRING_A}" appendQueryString="false" redirectType="Found" /> 

</rule>

</rules>

</rewrite>

 

Note: Please consider configuring URL rewrites using below article whether its supported or not by Microsoft.

https://support.microsoft.com/en-us/office/supportability-of-rewrites-and-redirects-in-sharepoint-20... 

1 Reply

@sujeetsks Unless MS has changed something, this isn't working for me.  I am running the August 2021 CU.  Can someone verify?