Created
April 5, 2017 18:49
-
-
Save nathanp/02a615fbc7e8bac6ca139c6c3bea38e7 to your computer and use it in GitHub Desktop.
Sample .htaccess configuration to use the dl-file.php from https://gist.github.com/nathanp/50e76eb23a3f084cce4205657ee71acc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# BEGIN WordPress | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteBase / | |
RewriteRule ^index\.php$ - [L] | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule . /index.php [L] | |
# BEGIN THIS DL-FILE.PHP ADDITION | |
RewriteCond %{REQUEST_URI} ^.*wp-content/uploads/membersonly/.* | |
RewriteRule ^wp-content/uploads/(membersonly/.*)$ dl-file.php?file=$1 [QSA,L] | |
# END THIS DL-FILE.PHP ADDITION | |
</IfModule> | |
# END WordPress |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment