I use wordpress 4.9.8. I want to close user access to site/wp-signup.php I added code in .htaccess
<Files wp-signup.php>
Order Allow,Deny
Deny from all
</Files>
When I go to site/wp-signup.php, I get error 403.It's good for me.
But if I follow the link /wp-signup and /wp-signup.ph and /wp-signup.p etc I get the following error:
This error is formed from a file - wp-includes/functions.php line 2722. How to display 403 error with any link /wp-signup ?
Thanks for help!
I use wordpress 4.9.8. I want to close user access to site/wp-signup.php I added code in .htaccess
<Files wp-signup.php>
Order Allow,Deny
Deny from all
</Files>
When I go to site/wp-signup.php, I get error 403.It's good for me.
But if I follow the link /wp-signup and /wp-signup.ph and /wp-signup.p etc I get the following error:
This error is formed from a file - wp-includes/functions.php line 2722. How to display 403 error with any link /wp-signup ?
Thanks for help!
The <Files>
directive is used to target specific files on the filesystem, not URLs. To change this to target any URL that starts /wp-signup
then use mod_rewrite instead. For example:
RewriteRule ^wp-signup - [F]
This must go at the top of your .htaccess
file.