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

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 30 2025 19:44:49
Script start
Timing: Jan 30 2025 19:44:49
Module start 'layout'
Timing: Jan 30 2025 19:44:49
Module start 'content'
Timing: Jan 30 2025 19:44:50
Module end 'content'
Timing: Jan 30 2025 19:44:50
Script end

Main resources:

Total runtime0.0267 sec
Peak memory usage8,192.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0047 588.2578151.2266
Module start 'layout' 0.00470.0057 739.4844220.7188
Module start 'content' 0.01050.0145 960.20311,005.8359
Module end 'content' 0.02490.0017 1,966.039137.9922
Script end 0.0267  2,004.0313 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002710.1291140.0002
Check MTime0.00103.8659140.0001
Mysql Total
Database connection0.00062.347210.0006
Mysqli_queries0.003111.661230.0010
Looping result0.00000.097310.0000
Template Total0.00124.610.0012
Template load0.00093.482910.0009
Template processing0.00031.078510.0003
Override
Cache load0.00072.449910.0007
General
dbfile0.00186.782880.0002
String conversion0.00000.048240.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs