Jump to content

Templates & access restictions on multilanguage site


DV-JF
 Share

Recommended Posts

Hey, following problem:

I'm trying to redirect all guest users which have no access to a specific page where they can login. My template access settings:

353683062_2023-03-2308_28_47-Window.thumb.png.78d8011cfd2ce884b504b4f7c01e4e50.png

This works fine until I switch the language. All users are redirected to the login-page but in default language. Is this supposed to be that way, how can I fix this so that the user will be redirected to the corresponding login-page in correct language e.g.

example.com/fr/login/?id=1030
example.com/en/login/?id=1030
example.com/es/login/?id=1030

Any hints or ideas?

Link to comment
Share on other sites

Hi @DV-JF

Probably you can use 1 option and then make a hook to 'ProcessPageView::pageNotFound' and within the hook, definition make a redirect to the login page like

$this->wire()->pages('/login/')->url([
	'language' => $this->wire()->user->language,
])

 

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

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