Forum Discussion
sujeetsks
Aug 24, 2021Copper Contributor
Redirect modern search page to classic search center page in SharePoint 2019
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.