When user types some invalid text in custom community URL, system redirects you to Standard Salesforce UI with error message as 'URL No Longer Exists'. But Global Search is available in this page. So external community user is able to search and access some public data which they should not see.
How could we avoid showing standard sfui if external VF site url is broken or any other issues such as 'Insufficient Privileges' occur? Any suggestions please.
Below are the screenshots of URL and Standard SFUI page,