htaccess - How disable canonical redirect wp-signup

admin2025-06-06  7

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!

Share Improve this question asked Nov 12, 2018 at 17:46 JhonnyMnemonikJhonnyMnemonik 132 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

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.

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1749188585a317105.html

最新回复(0)