Title: Adding A Redirect?
Last modified: January 2, 2017

---

# Adding A Redirect?

 *  Resolved [Scott Fichter](https://wordpress.org/support/users/surge42/)
 * (@surge42)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/adding-a-redirect/)
 * First off I’d like to thank you very much for this great plugin! It stops 90%
   of the nonsense that hits the admin login.
 * I wonder, is there a way to add a redirect if the code that is entered is not
   correct? I’d like to redirect bad users to this happy page. [http://www.sanger.dk/](http://www.sanger.dk/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [Mitch](https://wordpress.org/support/users/lowest/)
 * (@lowest)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/adding-a-redirect/#post-8654755)
 * That is possible, but I don’t think it’ll become a feature in this plugin.
 * If you still want to archieve this:
 * Open the `authentication-code.php` file, and find this piece of coding (line 
   no. 130):
 *     ```
       		if( ! $is_valid_auth_code ) {
       			$user = new WP_Error(
       				'invalid_auth_code',
       				sprintf(
       					'<strong>%s</strong>: %s',
       					esc_html__( 'ERROR', 'authcode' ),
       					esc_html__( 'Authentication code is invalid.', 'authcode' )
       				)
       			);
       		}
       ```
   
 * Replace that piece of coding with this:
 *     ```
       		if( ! $is_valid_auth_code ) {
       			$url = 'http://www.sanger.dk/';
       			$user = wp_redirect($url);
       		}
       ```
   
 * Save the file. Once the visitor enters the wrong auth code, he will be redirected
   to your happy page.
 * For any questions, feel free to let me know.

Viewing 1 replies (of 1 total)

The topic ‘Adding A Redirect?’ is closed to new replies.

 * ![](https://ps.w.org/authentication-code/assets/icon-256x256.png?rev=1461083)
 * [Authentication Code](https://wordpress.org/plugins/authentication-code/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/authentication-code/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/authentication-code/)
 * [Active Topics](https://wordpress.org/support/plugin/authentication-code/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/authentication-code/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/authentication-code/reviews/)

## Tags

 * [redirect](https://wordpress.org/support/topic-tag/redirect/)
 * [security code](https://wordpress.org/support/topic-tag/security-code/)

 * 1 reply
 * 2 participants
 * Last reply from: [Mitch](https://wordpress.org/support/users/lowest/)
 * Last activity: [9 years, 4 months ago](https://wordpress.org/support/topic/adding-a-redirect/#post-8654755)
 * Status: resolved