Jump to content

Link redirect lang


FrenchMarie

Recommended Posts

Hello,

I am coming to you following a problem using lang in a PHP file for the redirection of the index file.

I don't know if the solution exists but I hope to have your help, you will find attached the part of the code :

if ($vars['templatefile']=="homepage"){
	$_SESSION['Language'];
	$link = $_LANG["localeLanguage"];
	header("Location: " . $link);
	exit;
}

A big thank you in advance for your advice and for your help

Link to comment
Share on other sites

assuming that you have created a Language Override for 'localeLanguage' (it's not a default language string)...

$_LANG['localeLanguage'] = "https://www.google.com";

... then you could do this in the hook...

if ($vars['templatefile']=="homepage"){
	$link = Lang::trans('localeLanguage');
	if ($link != 'localeLanguage') {
		header("Location: " . $link);
		exit;
	}
}

and that should, assuming the language string exists, redirect users to the URL defined in the language overrides file for the current selected language.... if no string exists, then there is no redirection.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated