Forums / General / Wildcard Alias Not Working

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.