I have a multisite installation and use an .htaccess directive to close access to wp-login.php.

<files wp-login.php>
errordocument 403 http://example.com/restricted/
order deny,allow
deny from all

Is there a way that I can allow access to a specific individual site using another directive?

I don't know how multisite generates those URLs, as I don't see an obvious rewrite rule.

  • So you want to restrict access to ./wp-login.php for all sites except for one in particular, correct? Are you using a subdirecory or a subdomain installation? Is the site that is to be permitted access the main site, or a sub-site?
    – bosco
    Commented Sep 12, 2015 at 2:10

1 Answer 1


If you want to provide restricted access, you should add an additional string with the /wp-login.php URL. For example:


If the URL does not have such a string parameter, then you can redirect them to a 404 page; you don't need to rewrite the .htaccess file for it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.