$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>htaccess - How disable canonical redirect wp-signup|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

htaccess - How disable canonical redirect wp-signup

matteradmin9PV0评论

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.

Post a comment

comment list (0)

  1. No comments so far