Forums / Install & configuration / Custom url aliases and pathprefix

Custom url aliases and pathprefix

Author Message

Sander van den Akker

Thursday 17 June 2010 1:50:06 am

Hi community! I'm having trouble getting custom urlaliases to work on one of our sites. When I click advanced > manage url aliases on the node in the tree and check both 'Alias should redirect to its destination' and 'Place alias on the site root' the alias won't work. When I uncheck both options it doesn't work either.

I suspect it has something to do with the recent upgrade to a multisite environment and the pathprefix setting. The pathprefix is not used in the admin siteaccess where the aliases are generated, but they are in the user siteaccesses.

Anyone got a clue where to look further?

eZ Publish certified developer
http://auth.ez.no/certification/verify/392313

Sander van den Akker

Thursday 17 June 2010 1:58:43 am

I also tried to include the pathprefix that is set in the user siteaccess in the custom alias, but that didn't work.

eZ Publish certified developer
http://auth.ez.no/certification/verify/392313

Nicolas Pastorino

Thursday 17 June 2010 3:15:54 pm

Hoi Sander,

Which version of eZ are you trying this on, and what was the migration path ?
Also, was this working smoothly before migration ?

Let us know,
Cheers!

--
Nicolas Pastorino
Director Community - eZ
Member of the Community Project Board

eZ Publish Community on twitter: http://twitter.com/ezcommunity

t : http://twitter.com/jeanvoye
G+ : http://plus.tl/jeanvoye

Sander van den Akker

Friday 18 June 2010 4:35:46 am

It worked on eZ 4.3 without any problems, but since we implemented the simple multisite feature that is offered in the ezpagedata operator, together with the pathprefix setting (we use subdomains for siteaccesses) it stopped working.

For example: a custom alias 'sub/shortcut' should generate an alias http://sub.test.com/shortcut to the original node. This does not work, and neither does an alias without 'sub/'.

Thanks for your help Nicolas!

eZ Publish certified developer
http://auth.ez.no/certification/verify/392313

Sander van den Akker

Friday 18 June 2010 5:01:12 am

It seems to have to do with the setting DefaultErrorHandler=redirect in error.ini too. When this handler is used instead of displayerror, the aliases fail. When I use DefaultErrorHandler=displayerror the aliases do work.

It looks like a combination of a pathprefix and the above setting triggers a bug somewhere in the custom url alias code, because in our admin siteaccess (without pathprefix) custom aliases work fine.

eZ Publish certified developer
http://auth.ez.no/certification/verify/392313

Sander van den Akker

Wednesday 30 June 2010 2:59:53 am

Here is the solution:

http://issues.ez.no/IssueView.php?Id=14988&ProjectId=3

eZ Publish certified developer
http://auth.ez.no/certification/verify/392313