Arrow

Redirection based on current directory of login page | Peter's Login Redirect | Forum

Back to the login redirect plugin page

Please consider registering
guest

Log In

Lost password?
Advanced Search

— Forum Scope —

  

— Match —

   

— Forum Options —

   

Minimum search word length is 4 characters - maximum search word length is 84 characters

Topic RSS
Redirection based on current directory of login page
April 11, 2013
11:32 am
JoeWa1980
New Member
Forum Posts: 1
Offline

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!!

April 11, 2013
4:03 pm
Peter
Admin
Forum Posts: 841
Offline

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

December 29, 2013
5:06 am
mirasexy
New Member
Forum Posts: 1
Offline

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

December 29, 2013
9:23 am
Peter
Admin
Forum Posts: 841
Offline

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.