Skip to content

Instantly share code, notes, and snippets.

@ingozoell
Created June 18, 2014 09:28
Show Gist options
  • Save ingozoell/b766c3519605e498e773 to your computer and use it in GitHub Desktop.
Save ingozoell/b766c3519605e498e773 to your computer and use it in GitHub Desktop.
WP – Protected private uploads (*-inter.*)
<IfModule mod_rewrite.c>
RewriteEngine On
# RewriteCond %{REQUEST_URI} ^.*assets/.*
RewriteCond %{REQUEST_FILENAME} ^.*-intern.(jpg|jpeg|gif|bmp|png|pdf)$
RewriteCond %{HTTP_COOKIE} !^.*wordpress_logged_in.*$ [NC]
RewriteRule . /wp-login.php?redirect_to=%{REQUEST_URI} [R,L]
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment