Please make sure to update to WPML 4.3.4 before reporting any issue

Hi, Amit here, I am the WPML Support Manager, our current ticket queue is high, update your WPML plugins and make sure you meet the minimal requirements for running WPML before reporting an issue please - many tickets are resolved doing that

Please look at our updated list of Known Issues and you can also use our support search to find helpful information and of course review our documentation before opening a ticket.

If you do need to open a ticket please make sure to provide us with all the needed information as described in this page

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 3 replies, has 2 voices.

Last updated by Bernat Torras 2 years, 7 months ago.

Assigned support staff: Bernat Torras.

Author Posts
March 27, 2017 at 9:03 pm #1240721

ideaspace

I am trying to: login in french page( hidden link )

URL of (m
y) website where problem appears: hidden link

I expected to see: dashboard after login hidden link

Instead, I got: hidden link

Steps to duplicate the issue: login with french page.. refer to screen shot

hidden link - Returns 404

hidden link - It works, logout is completed without problems.
hidden link - Returns 404

March 28, 2017 at 10:36 am #1241201

Bernat Torras

Hi @rondap,

Thanks for contacting support, I'll do my best to help you with this! 🙂

The reason you're getting a 404 page when trying to login in french is because the link is pointing to default wp-login.php page. This is a default wordpress php file and it is not translatable.

Could you tell us where is this login button (the one in you header) coming from? Does it come by default with your theme or you've added it manually (or with a plugin)?

Once we know it, we'll try to replicate it in a fresh install and if its a compatibility issue, we'll contact the authors to suggest them the best way to fix it. In any case, take in mind that the solution will probably be to ignore the current language in this link url, redirecting the users always to default wp-login.php page.

If you need to get it working, you could try to use "language as a parameter" option in WPML>Languages meanwhile. This will transform your urls in your secondary language, removing the language code directory (.../fr/...) and adding it as a parameter (...?lang=fr). I think that this change should make you able to access the wp-login.php without problems using the link in your secondary language.

Could you please provide us the information and check if the temporarily workaround works for you?

Thanks
Bernat

March 28, 2017 at 1:45 pm #1241425

ideaspace

Login button is coming from default theme header file (themes/cca/header.php), added it manually..

If we redirecting the users always (or submitting the form) to default wp-login.php page with lang=fr parameter how can we redirect to French page after successful login?

I just changed login form submit url with wp-login.php?lang=fr instead of /fr/wp-login.php. after that login is working fine but it's redirecting to default english front page ( hidden link). is there any way to deduct the language and redirect to that language page after login?

March 29, 2017 at 6:36 am #1241954

Bernat Torras

Hi @rondap,

Well, the truth is that this is not the best scenario, because its hard to keep the language parameter on login.php page (for example it can get removed from the url after a wrong login attempt), but if you want to try it anyway, you could add a code like the following in your functions.php:

function login_redirect_lang( $redirect_to, $request, $user ) {
	if(isset($_GET['lang'])){
		$redirect_to = get_bloginfo('url').'?lang='.$_GET['lang'];
	}	
	return $redirect_to;
}
add_filter( 'login_redirect', 'login_redirect_lang', 10, 3 );

This code will check the lang parameter in the url when trying to log in (please remember that this won't work always as in some cases the language parameter is stripped from the url) and redirect to the homepage of your site with the same lang parameter added.

If you want, you could take a deeper look at how wp-login.php works and check the official wordpress documentation to see if there are other filters or actions that you can use to extend this workaround. Also, if you want a better approach, you could also try to find some login plugin to use it instead of your theme login form or contact our certified contractors (https://wpml.org/documentation/support/wpml-contractors/) to ask them for help (as this functionality is above out support scope).

Hope it helps!

Thanks,
Bernat