This site has been archived and you can no longer log in or post new messages. For up-to-date community resources please visit

eZ Community » Forums » General » Language redirect shows 404 in the url

Language redirect shows 404 in the url

Language redirect shows 404 in the url

Friday 27 February 2015 1:21:04 pm - 4 replies

When I use language switcher the redirect goes to the right page in other language.
But, after every redirect adds '?/404' at the end of the url.
I can't debug it and find a way why is that happening.
Is it server configuration, or some ez publish setting missing?
I'm using Community Project 2014.11 (legacy code)

Modified on Friday 27 February 2015 1:21:52 pm by Sebastian Clay

Friday 27 February 2015 1:35:01 pm

happy.gif Emoticon
When I comment out this part

 if ( $this->queryString != '' )
    $finalUrl .= '?' . $this->queryString;

from kernel/private/class/ezplanguageswitcher.php the problem is gone.

Modified on Friday 27 February 2015 1:35:45 pm by Sebastian Clay

Friday 27 February 2015 6:11:21 pm

Hello Sebastian,

You should not modify (hack) eZ Publish kernel make changes to the kernel directory files. This is called kernel hacking and it causes serious problems long term and it is very very strongly discouraged.

Instead within a custom extension you should (if you truly need to modify this class php) create a kernel class override class (class which provides for full code copy plus your modifications). Store your modified class file in extension/yourcustomextensionname/classes/ezplanguageswitcher.php and regenerate autoloads.

This will help you ensure that future upgrades and maintenance is possible without worrying about possible modifications to default kernel files knowing that all your modifications are within the extension directory.

EDIT: I forgot to mention that this class file in question is designed to be customized via extensions and ini settings. Please read this related documentation:

Do the work the right way, never kernel hack! Best wishes ...

I hope this helps!


Saturday 28 February 2015 1:02:15 am

Hi Heath,
Thanks, I've placed custom code in my class.
The "hack" was really small but it's better to stick to the ez rules, so it's done as it should.


Saturday 07 March 2015 2:19:42 am

Hello Sebastian,

I'm pleased to hear you re-worked your solution into a proper extension override class.

Take it eZ!



You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from