Last active
February 6, 2018 16:41
-
-
Save joetek/fbc780872f582ce1aa34bb1e8f104e17 to your computer and use it in GitHub Desktop.
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
# .htaccess to block load-scripts.php and load-styles.php if user is not logged in. | |
# | |
# For styles, it redirects to the login.css, which includes *most* of the styles needed for the login screen. | |
# For scripts, it simply denies access with a 403 Forbidden. | |
# | |
# This workaround may have trouble if you have customized the login screen. Add this code to the top | |
# of your .htaccess file. | |
# | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteCond %{REQUEST_URI} load-styles\.php* | |
RewriteCond %{HTTP_COOKIE} !^.*wordpress_logged_in.*$ [NC] | |
RewriteRule (.*) /wp-admin/css/login.css [R=302,L] | |
RewriteCond %{REQUEST_URI} load-scripts\.php* | |
RewriteCond %{HTTP_COOKIE} !^.*wordpress_logged_in.*$ [NC] | |
RewriteRule (.*) / [F] | |
</ifModule> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment