function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
naresh shettynaresh shetty 

disable the standard page layout view for Custom branded Community Portal

Rahul KumarRahul Kumar (Salesforce Developers) 
Hi Naresh,
 
Solution:
The following is easiest option to avoid these issue.
Step 1: Create the html page as below and upload into document which should be available for the community.
<html>
<head>
</head>
<script>
            window.onload = top.location.href = 'ErrorPage'; (Your custom error page or custom landing page)
 </script>
<body>
</body>
</html>
Step 2: Add this document in the Community Custom Header (Via community management screen) 
This will allows to redirect the user when they manipulating the URL which is valid salesforce URL.
Please check the below link for reference. hope it helps.

Please mark it as best answer if the information is informative.

Thanks
Rahul Kumar