Is there any way to restrict the pages based on the user groups?
Definitely. Set security on any content in admin is easiest. Remove access for everyone and add any group you want...
Content inherit security settings from the parent node normally
Check out the admin handbook at
and read the section about "Access rights in the content structure"
Thanks for your reply.
How to handle this by code or Api. Any idea.
You can filter any content or collection easiest by using EPiServer.Filters...
Usually the easiest way is to use FilterContentForVisitor
I have given read access only to my user group, but when i render the page in browser it redirects to episerver editor login page.
But i need to redirect to my custom login page. Is that possible. And i have used this code in rendering page Template.
bool val = CurrentPage.ACL.QueryDistinctAccess(EPiServer.Security.AccessLevel.Read);
Epi will automatically redirect you to login page if you dont have access to current page so your code will never be used.
The login page Epi will use as target is the one set in web.config. Search for login.aspx and replace that with url to your custom page