Skip to content

Instantly share code, notes, and snippets.

@lukecav
Created August 17, 2022 20:06
Show Gist options
  • Select an option

  • Save lukecav/2bebfad7ce5a5fb63fca63117a7758bf to your computer and use it in GitHub Desktop.

Select an option

Save lukecav/2bebfad7ce5a5fb63fca63117a7758bf to your computer and use it in GitHub Desktop.
MemberPress plugin rewrite rules
# BEGIN MemberPress Rules
<IfModule mod_rewrite.c>
RewriteCond %{HTTP_COOKIE} mplk=([a-zA-Z0-9]+)
RewriteCond /var/www/somesite.com/wp-content/uploads/mepr/rules/%1 -f
RewriteRule ^(.*)$ - [L]
RewriteCond %{REQUEST_URI} !^/(wp-admin|wp-includes|wp-content/plugins|wp-content/themes)
RewriteCond %{REQUEST_URI} \.(zip|gz|tar|rar|doc|docx|xls|xlsx|xlsm|pdf|mp4|m4v|mp3|ts|key|m3u8|ZIP|GZ|TAR|RAR|DOC|DOCX|XLS|XLSX|XLSM|PDF|MP4|M4V|MP3|TS|KEY|M3U8)$
RewriteRule . /wp-content/plugins/memberpress/lock.php [L]
</IfModule>
# END MemberPress Rules
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment