I have a Magento store (version 1.8.1) and I installed an extension to export the Google product feed. I noticed that the URLs in the generated feed are redirecting so I did some checks and found that in the Magento admin all the simple product URL keys
are the same as the configurable products. How is that possible? Where does Magento pull the actual URL used on the front end from?
Add a comment
|
1 Answer
The product urls (yes urlS because they can me more than one) are kept in the core_url_rewrite
table.
if a record in that table has the field product_id
not null
then it belongs to the product and the request_path
is what you are looking for.
But you can have multiple cases.
- There is no record in the
core_url_rewrite
for a specific product id: This means that the product does not have a friendly url and it can be reached only atcatalog/product/view/id/{id_here}
. - You have a record for a specific product id:
- the
options
column is empty: You can reach the product at/{request_path_value}
. But there can be multiple records like this in the table. Some of them might have thecategory_id
column empty. This means that the product can be reached at/product.html
. Others have a value forcategory_id
. This means the product url looks like/category/product.html
or/category/sub-category/product.html
. You will have to pick the one you want. all of these urls are valid. - The
options
column has a value. This means that the url is actually a redirect (301 or 302) to an other page. You don't want to export these urls to any feeds. They should be there for url backwards compatibility.
- the