Title: Wrong redirect
Last modified: April 22, 2019

---

# Wrong redirect

 *  [smarty111](https://wordpress.org/support/users/smarty111/)
 * (@smarty111)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/wrong-redirect-6/)
 * Hello!
    Our site use Polylang for 12 languages in subdomain like ir.amarkets.
   com When i am try login on subdomain with Cerber – after login i am redirect 
   on main domain login page and need enter login again. That wrong.
 * Without Cerber i am redirect on current subdomain main page, and that right.
 * Example:
 * I am try login on ir.amarkets.com, after login i am redirect on [http://www.amarkets.com](http://www.amarkets.com)
   and need input login again.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fwrong-redirect-6%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 8 replies - 1 through 8 (of 8 total)

 *  Plugin Author [gioni](https://wordpress.org/support/users/gioni/)
 * (@gioni)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/wrong-redirect-6/#post-11465740)
 * Hi!
 * What kind of the login page do you use? Do you use a Custom login URL or the 
   default wp-login.php?
 *  Thread Starter [smarty111](https://wordpress.org/support/users/smarty111/)
 * (@smarty111)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/wrong-redirect-6/#post-11465757)
 * Yes, we use custom link
 *  Plugin Author [gioni](https://wordpress.org/support/users/gioni/)
 * (@gioni)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/wrong-redirect-6/#post-11495207)
 * If you can you edit PHP files, let’s do the following. Open the common.php file
   that is located in the plugins folder. Comment out 232 and 234 lines this way:
 *     ```
       function cerber_get_home_url() {
       	static $url;
   
       //      if ( ! isset( $url ) ) {
       		$url = trim( get_home_url(), '/' );
       //	}
   
       	return $url;
       }
       ```
   
 * Save the file, check how the redirection works.
 *  Thread Starter [smarty111](https://wordpress.org/support/users/smarty111/)
 * (@smarty111)
 * [7 years ago](https://wordpress.org/support/topic/wrong-redirect-6/#post-11538300)
 * Can you fix this in the next update or add the ability to specify this to the
   settings?(checkbox for custom link for example)
 * Unfortunately, our company policy does not allow custom code insertion into plugins.
 *  Plugin Author [gioni](https://wordpress.org/support/users/gioni/)
 * (@gioni)
 * [7 years ago](https://wordpress.org/support/topic/wrong-redirect-6/#post-11539384)
 * I cannot fix anything until I know the cause of an issue. I suggest that you 
   comment out a couple of lines in the plugin’s code which I suspect can cause 
   the issue. So with no action on your side, there is nothing to fix.
 *  Thread Starter [smarty111](https://wordpress.org/support/users/smarty111/)
 * (@smarty111)
 * [7 years ago](https://wordpress.org/support/topic/wrong-redirect-6/#post-11539416)
 *     ```
       function cerber_get_home_url() {
       	static $url;
   
       //      if ( ! isset( $url ) ) {
       		$url = trim( get_home_url(), '/' );
       //	}
   
       	return $url;
       }
       ```
   
 * That not work, our login link look like:
 * [http://lang.site.test/custom/](http://lang.site.test/custom/)
 * Before i am login on subdomain i am redirect on:
 * [http://www.site.test/custom/?redirect_to=http%3A%2F%2Fwww.site.test%2Fwp-admin%2F&reauth=1](http://www.site.test/custom/?redirect_to=http%3A%2F%2Fwww.site.test%2Fwp-admin%2F&reauth=1)
 * I am redirect from lang subdomain to main domain with this GET.
 *  Plugin Author [gioni](https://wordpress.org/support/users/gioni/)
 * (@gioni)
 * [7 years ago](https://wordpress.org/support/topic/wrong-redirect-6/#post-11546001)
 * Are you redirected to the main site login page “[http://www.site.test/custom/&#8221](http://www.site.test/custom/&#8221);
   when you enter in the browser “[http://lang.site.test/custom/&#8221](http://lang.site.test/custom/&#8221);?
 *  Thread Starter [smarty111](https://wordpress.org/support/users/smarty111/)
 * (@smarty111)
 * [7 years ago](https://wordpress.org/support/topic/wrong-redirect-6/#post-11550178)
 * No, i am not redirect when i am enter on page, i am redirect after enter fields
   and press login, and after that iam need enter fields again on main www site.
    -  This reply was modified 7 years ago by [smarty111](https://wordpress.org/support/users/smarty111/).

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Wrong redirect’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wp-cerber_77a9bf.svg)
 * [WP Cerber Security, Anti-spam & Malware Scan](https://wordpress.org/plugins/wp-cerber/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-cerber/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-cerber/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-cerber/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-cerber/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-cerber/reviews/)

## Tags

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

 * 8 replies
 * 2 participants
 * Last reply from: [smarty111](https://wordpress.org/support/users/smarty111/)
 * Last activity: [7 years ago](https://wordpress.org/support/topic/wrong-redirect-6/#post-11550178)
 * Status: not resolved