Redirection based on current directory of login page | Peter's Login Redirect | Forum
Back to the login redirect plugin page
11:32 am
Hi there Peter, loving your plugins!
We use Transposh which adds a virtual directory to the main site url.
So our English login page is here: mydomain.com/login
And our Czech login page is here: mydomain.com/login/cs
(both use the same Wordpress installation, database etc etc)
Both pages need to redirect to /dashboard/ but... the Czech one needs to be appended with /cs/dashboard/ otherwise it'll head to the English site!
Can you suggest what specific code to add to achieve this? Thanks very much!!
Hi, you have a couple of options here: you can either write your own redirect handler (see the "Custom redirect rules" section here: http://wordpress.org/extend/pl.....her_notes/), or create your own redirect URL variable (see the "Custom variable parameter" section at the bottom of the same page).
The redirect URL variable is probably the more suitable case. You would enter something like this as the redirect URL and then your own logic could check the referrer URL or some other variable to determine whether or not to prepend the language:
[variable]language[/variable]/dashboard
5:06 am
Dear Peter,
im having the same problem and i need essential help ;-(
could u please explain this to me as a noob...i redirect to [variable]language[/variable]/dashboard but nothing happens still redirecting to english language. Do i have to edit any other file first???
btw: my wp-content folder now has other name. does this affect the plugin?
thx
Hi,
The "language" variable is not available out of the box. You have to write your own PHP code to look up the language similar to the example under the "Custom variable parameters" section in the documentation: http://wordpress.org/plugins/p.....her_notes/. There is no specific code example for "language" yet until someone write and shares one
I don't think that renaming the wp-content folder affects the plugin.