I have a SharePoint publishing site with anonymous access with domain eg xxx.xxxxxxxx.com. Whenever I request the following URL it is asking me for credentials.
The above URL points to the pages which are Documents and Libraries. I don't want the site to ask for credentials for the above URL. The following will be my home page. https://xxx.xxxxxxxx.com/EN/Pages/Default.aspx
So I don't want my SharePoint site to ask for credentials if the URL is pointing to Documents and Libraries. In this scenario I want the URL to be redirecting to the home page. Also, I don't want anonymous users to access the page library or any administrator features.
I have done some R&D on my part but haven't got any solution. Some suggested using SharePoint:SpSecurityTrimmedControl for hiding the elements for the anonymous users, but I don't think it is useful for what I want to achieve. Here is the link that suggested SharePoint:SpSecurityTrimmedControl https://techcommunity.microsoft.com/t5/sharepoint-developer/how-to-hide-login-prompt-for-sharepoint-2016-admin-url-s-via/m-p/354539
Below is the screenshot of what I don't want to show to the anonymous users.