New Rewrite
From AMember Pro Manual
This plugin allows you add cookie-based login for ANY protected content. It can protect both HTML files, downloadable content, and even complex PHP scripts. Currently, it is better and most recommended protection technique.
Useful if:
- You wish to protect CGI/PHP scripts, HTML content, images or downloads;
Not useful if:
- Your server does not support mod_rewrite.
- You/your scripts are already using PHP rewrite. In this case, this method may not work from scratch.
[edit] Requirements
- mod_rewrite available from .htaccess files (see below)
[edit] Setting Up Protection
Please go to aMember CP -> Protect Folders function and choose new_rewrite protection method.
[edit] How does it work (for programmers only)
Once user logs-in to aMember, it sets up an unique cookie named amember_nr and creates several files in amember/data/new_rewrite/ folder. Specially constructed mod_rewrite rules in .htaccess file from the protected folder will check if user has the cookie set, and if files in the folder are actually created, and user has necessary access rights for the folder (active subscriptions to products). If yes, user is allowed to view requested page, image or file. If not, user redirected to aMember login page, where he can login, or signup-pay then login.
