Creating user friendly URLs
So far, throughout the development process, we have been using the default format of our Yii application URL structure. This format, discussed back in Chapter 2, uses a querystring approach. We have the main parameter, 'r', which stands for route, followed by a controllerID/actionID pair, and then optional querystring parameters as needed by the specific action methods being called. The URL we created for our new feed is no exception. It is a long, cumbersome and dare we say ugly URL. There has got to be a better way! Well, in fact, there is.
We could make the above URL look cleaner and more self-explanatory by using the so-called path format, which eliminates the query string and puts the GET parameters into the path info part of URL:
Taking our comment feed URL as an example, instead of:
http://localhost/trackstar/index.php?r=comment/feed
we would have:
http://localhost/trackstar/index.php/comment/feed/
What's more, we don't even need to always specify the entry...