Wildcard Alias Not Working

Author Message

Russell Michell

Tuesday 22 July 2008 4:47:06 pm

Hi there,

I'm using eZ 4.0 with ezwebin and am trying to get Wildcard Aliases working, but nothing I have tried works and nothing dodgy shows up in any of the logs.

My site runs on my local Linux machine on port 8085 (There is another eZ install on 8086) and the siteaccess is called "duty" so the base URL to the root of this eZ site is: http://my-host.co.nz:8085/duty. The "duty" site is setup as an eZ extension, based on the ezwebin extension as outlined at this tutorial: http://ezpedia.org/wiki/nl/ez/overriding_the_ez_web_interface_ezwebin_with_custom_designs

The relevant contents of my override/site.ini.append.php:

[SiteAccessSettings]
CheckValidity=false
AvailableSiteAccessList[]=duty
AvailableSiteAccessList[]=duty_admin
AvailableSiteAccessList[]=eng
MatchOrder=uri
# Wildcard aliases don't work regardless of ForceVirtualHost setting commented-out or not
ForceVirtualHost=true
HostMatchMapItems[]

..and siteaccess/duty/site.ini.append.php:

[SiteSettings]
SiteName=Duty Team Website [DEV]
SiteURL=my-host.co.nz:8085/duty
LoginPage=embedded
AdditionalLoginFormActionURL=http://my-host.co.nz:8085/duty_admin/user/login
# Ensure this SA knows where to start from:
IndexPage=/content/view/full/192
# Ensure navigation elements aren't confused:
# Wildcard aliases don't work regardless of RootNodeDepth setting commented-out or not
RootNodeDepth=2

[SiteAccessSettings]
RequireUserLogin=false
RelatedSiteAccessList[]=duty
RelatedSiteAccessList[]=eng
RelatedSiteAccessList[]=duty_admin
ShowHiddenNodes=false
# Wildcard aliases don't work regardless of PathPrefix setting commented-out or not
PathPrefix=Duty-Website

To setup my Wildcard Alias:

* admin --> setup --> URL Wildcards
* The first field: /duty/folder_name/*
* The second field: /duty/folder_name_2/{1}
* Redirecting URL (checked - I have tried both checked and unchecked to no avail)
* Cleared all caches
* Ran: #> php bin/php/updateniceurls.php -s duty -vv -d
* In Firefox I went to: my-host.co.nz:8085/duty/folder_name/blah, I assumed it would redirect to /duty/folder_name_2/blah...but nothing happened, no error, nothing in the logs.

I must have missed something really obvious as no-one else seems to have had this issue after scouring Google all morning.

Can anyone help me out at all!?

Thanks a lot for reading :-)
Russ

Russell Michell, Wellington, New Zealand.
We're building! http://www.theruss.com/blog/
I'm on Twitter: http://twitter.com/therussdotcom

Believe nothing, consider everything.

Russell Michell

Tuesday 22 July 2008 6:46:50 pm

Still not working however...

Using "/folder_name/*" doesn't work. But using "folder_name/*" does! This conflicts with the tooltip (HTML title="" attribute) in the eZ admin interface which uses the "/" prefix.

Something else I forgot to mention: The URI pattern I'm putting into the first field is a virtual path to content that already exists in the eZ hierarchy. I'm actually trying to redirect from an object of a Custom Class which supplies data to an eZ RSS feed, to a regular Folder content object.

So at the moment I can go:"folder_name/blah" (Exists in eZ but does nothing). But "folder_name/bla" (Doesn't exist in eZ but does tries redirect but gives a modeul not found error) redirecting to: "folder_name_2/bla".

It seems to be something either to do with existing (generated) URLs taking precedence or not allowing existing URLs to be redirected in this manner (using wildcards)...

Will investigate further...

Russell Michell, Wellington, New Zealand.
We're building! http://www.theruss.com/blog/
I'm on Twitter: http://twitter.com/therussdotcom

Believe nothing, consider everything.

Kristof Coomans

Tuesday 22 July 2008 10:58:39 pm

Hi Russ

The tooltip bug has been reported some days ago, see http://issues.ez.no/13364. Cheers!

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Russell Michell

Thursday 24 July 2008 3:28:10 pm

Hey Kristof and thanks for the heads-up re: the bug.

I have sorted my issue. As far as I can tell, Wildcard Aliasing will not work when the Virtual URL you want to redirect <i>from</i> already exists as some content-class or other.

What I did to solve this, was:

* Configured my RSS feed to prefix all RSS <link> element URIs with a unique string (I used "/export")
* Created a Wildcard Alias that redirected everything from "/export/blah-1/*" to "/my-siteaccess/blah-1/{1}"

As an aside, I was trying with URL Aliases for individual content objects but found when I moved them into another location, their URL Aliases were not retained. Is this a bug?

Cheers :-)

Russell Michell, Wellington, New Zealand.
We're building! http://www.theruss.com/blog/
I'm on Twitter: http://twitter.com/therussdotcom

Believe nothing, consider everything.

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 19 2025 01:05:26
Script start
Timing: Jan 19 2025 01:05:26
Module start 'layout'
Timing: Jan 19 2025 01:05:26
Module start 'content'
Timing: Jan 19 2025 01:05:26
Module end 'content'
Timing: Jan 19 2025 01:05:26
Script end

Main resources:

Total runtime0.6643 sec
Peak memory usage4,096.0000 KB
Database Queries60

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0058 589.1484152.6250
Module start 'layout' 0.00580.0035 741.773439.4453
Module start 'content' 0.00930.6535 781.2188574.3594
Module end 'content' 0.66280.0015 1,355.578116.1641
Script end 0.6643  1,371.7422 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00380.5653160.0002
Check MTime0.00140.2072160.0001
Mysql Total
Database connection0.00140.212410.0014
Mysqli_queries0.586488.2696600.0098
Looping result0.00060.0887580.0000
Template Total0.617292.920.3086
Template load0.00240.365920.0012
Template processing0.614892.539920.3074
Template load and register function0.00010.021810.0001
states
state_id_array0.00500.759410.0050
state_identifier_array0.00140.213720.0007
Override
Cache load0.00220.3358690.0000
Sytem overhead
Fetch class attribute can translate value0.00050.081420.0003
Fetch class attribute name0.00100.148160.0002
XML
Image XML parsing0.00260.391720.0013
class_abstraction
Instantiating content class attribute0.00000.002880.0000
General
dbfile0.00550.8308220.0003
String conversion0.00000.001140.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
4content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
10content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
6content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 26
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs