Share » Forums » Developer » How does ez publish parse fancy...

How does ez publish parse fancy "/obj1/obj2/obj3" URL's through one design script ? possible to do in PHP ?

How does ez publish parse fancy "/obj1/obj2/obj3" URL's through one design script ? possible to do in PHP ?

Tuesday 29 June 2004 3:39:17 am - 3 replies

Author Message

Bård Farstad

Tuesday 29 June 2004 4:09:55 am

This is actually rather simple to make. What we do is to store an alias for all objects. When we store an object we generate the "path" to that object based on the names of the parents (e.g. /frontpage/news/latest_news ). This name is converted into only valid characters.

When you request a page eZ publish will first check if there exists an alias for the current url, if it does it will look up in this alias to see which "page id" it should use.

--bård

Documentation: http://ez.no/doc

Armen Zourabian

Tuesday 29 June 2004 4:48:43 am

Takk for svaret bård ;)

But then again, yo explained the other half of the function, but how does the server know which file to send when you request an URL of "/obj1/obj2/obj3" ? Usually server map virtual directories to physical directories on the server disk, but in ez case, they are completely virtual maps ? That is what I am interested in. I would like to create similiar framework in PHP, and do not want to create directories called obj1, obj2 or obj3...

And since you mentioned that "ez publish checks the alias", this already implies that whatever URL, the request is sent to one master script right which does this checking?

Bård Farstad

Tuesday 29 June 2004 5:02:21 am

We use apache rewrite rules so all requests are sent to index.php. In this file we simply check if the requested uri e.g. /obj1/obj2/obj3 is in our alias table, if so -> then serve that page.

We use the $_SERVER['REQUEST_URI'] variable in PHP for fetching the current URI.

--bård

Documentation: http://ez.no/doc

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

36 542 Users on board!

Forums menu