tags:

views:

344

answers:

1

Hello,

We used django and in django there is one file urls.py which mention all possible url patterns. So we just want to know that when i open url http://localhost/magento/index.php/test123.html how this will map to product and which file i can check for this.

A: 

Magento has more than one way of matching URLs. modules can register their own patterns, and these will generally be of the form /module/controller/action

In addition, CMS pages have URL identifiers and these can be anything you like - they can contain /s to give the illusion of hierarchy, but they're not significant.

Finally, Categories and Products have URL identifiers and there's a whole table of URL rewrites that map a path (/[category]/[subcategory]/[product] for example) to a product. In your example, I would guess that the product's URL identifier is 'test123' and that the store is setup to suffix URLs with '.html'

So, there's no file to look in (in this case), but rather the database/admin area.

Greg
Thx Greg,I checked in app/code/core/Mage/Catalog/controllers/ there are i found file ProductController.php. I checked in that but i cant get any idea from that. I was just looking for entry function in that class. Means where they parse url in this class. Like if we give url localhost/index.html/test123.html then they have to get test123.html and remove .html from that and search for test123 product in db and then return that data with his template. If possible just give me entry point in this class. Where they get this url and how they parse in this class in this file ProductController.php
Nil
off the top of my head app/code/core/Mage/Catalog/Controller/Router.php ... it's Router.php somewhere anyway, maybe another folder under Controller? This, along with the CMS router and any others that might be registered get called one after another until one tells the front-controller that it's going to handle a URL, and then the appropriate action-method of a controller is called. It's not something you'd normally need to mess with though...are you trying to fix a problem, or just curious?
Greg