Site Access Restriction (SAR) - How To - Restrict By URLs, URL Path
Access Restriction by URL Filtering
Plugin also support restriction access to specific URL's on your site. This is very useful when you want to prevent access to specific section of plugins which use get params or you want to define only specific pages or post.
For example, you can restrict access to the URL which looks like this:
While the generic URL http://yoursite.com/categories will not have any restriction.
To add URL filtering:
Find the plugin on the Admin Dashboard, and click to access the drop down menu. Then click URL filters.
You can Add a new Filter. Each URL can have the general restriction.
- Access not restricted - Access is allowed to all roles including non authorized users.
- Access restricted to logged-in users - This means that all roles are authorized.
- Access denied X days from user first access - Set the number of days of access expiration. After passing this amount of days the user loses his access to the content after first accessing it. This option was introduced in version 1.5.8.
- Allow only anonymous access - Only non-authorized users are allowed to view the content. This option was introduced in version 1.4.10.
- Access restricted by role - Once selected you can specify which roles can access content.
- Access restricted by whitelist - Only users from the whitelist are allowed to view the content. This option was introduced in version 1.4.10.
- Access restricted by blacklist - Access is restricted only for users from the blacklist. This option was introduced in version 1.4.10.
- Access restricted by specific date/time - Access is allowed only within defined period of time. You need to set start and end dates in the fields From and To. this options was introduced in version 1.5.8.
- Access denied X days from registration - Access is restricted for users that registered less than X days ago.
- Restriction message view - This option overrides global settings. Choose the view of the message that the user will see when he tries to get access to restricted page:
- Global settings - This is a default value. You can change it in the General tab of Settings.
- Restrict full content - works the same as in global settings.
- Restrict partially content - works the same as in global settings.
- Restrict content with shortcode only - works the same as in global settings. This feature was introduced in version 1.5.5.
It is possible to add multiple filters and to delete an existing filter.
When you are finished, click Save Filters to save changes.