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
Rajkumar VenkatRajkumar Venkat 

How to disable the Customer community standard page layout view for Custom branded Community Portal

Limitation:
Recently I came across the issue where customer community does not have option to disable the standard page layout view for community users.
 
Scenerio:
Like https://xy.force.com/portal/pagename?Id=18digitid - this will be correct url for customer community users.
 
Someone changing the url to valid salesforce url
https://xy.force.com/portal/18digitid  - this is going to standard customer community layout which has all the standard settings.
 
Issue:
Some customer does not want to allow the community users to view standard page layout. As said there are no standard options to disable the page layout for community users.
 
Best Answer chosen by Rajkumar Venkat
Rajkumar VenkatRajkumar Venkat
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.
 

All Answers

Rajkumar VenkatRajkumar Venkat
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.
 
This was selected as the best answer
naresh shettynaresh shetty
I am also facing same issue ... did above solution worked for you?
Prasanna Rotti 8Prasanna Rotti 8
you can do this by adding this tag customer community site xml 

<allowStandardPortalPages>false</allowStandardPortalPages>