49ac09ac by Jeff Balicki

lock down files

Signed-off-by: Jeff <jeff@gotenzing.com>
1 parent ae4fadd3
......@@ -25,11 +25,8 @@ RewriteRule . /index.php [L]
# require login for media files
# more info: https://m0n.co/11
<IfModule mod_rewrite.c>
RewriteCond %{REQUEST_URI} (\.pdf|\.docx|\.xlsx|\.ppt)$ [NC]
RewriteCond %{HTTP_COOKIE} !stc_logged_in [NC]
RewriteCond %{REQUEST_URI} (\.pdf|\.docx|\.xlsx|\.ppt|\.jpg)$ [NC]
RewriteCond %{HTTP_COOKIE} !wordpress_logged_in_([a-zA-Z0-9_]*) [NC]
RewriteRule (.*) https://stellervistaconnect.com/
</IfModule>
......
......@@ -270,13 +270,3 @@ add_action( 'init', 'wpa_91930' );
add_action( 'wp_login', 'add_custom_cookie' );
function add_custom_cookie() {
setcookie( 'stc_logged_in',rand(5, 15), time()+WEEK_IN_SECONDS );
}
// To Remove Cookie
add_action( 'wp_logout', 'remove_custom_cookie' );
function remove_custom_cookie() {
setcookie( 'stc_logged_in', '', -1000000 );
}
\ No newline at end of file
......