Magento – What Url Is To View A Magento Category

magento

First time using Magento here. I have styled the home page and product view page. The product view is working with urls http://domain.com/product-slug.html

I can't seem to figure out how I view a category to list the products. I have tried loads of different urls, and i thought http://domain.com/category/category-name.html would work but I just get 404.

Same with the following, all 404:

http://domain.com/category-name.html
http://domain.com/category/view/category-name.html
http://domain.com/category/view/categoryID

What on Earth is the url for this?

Best Answer

Category URLs in Magento have the following structure:

catalog/category/view/id/$CATEGORY_ID

(Where $CATEGORY_ID is replaced by an integer)

First you could check if the category page even loads by replacing $CATEGORY_ID with the ID of the category you mention in the question, and then navigate to that address in your browser's address bar.

Here is an example of the address you should test:

http://domain.com/catalog/category/view/id/6

Find the category ID by going to Catalog -> Manage Categories and selecting the category. The ID is right next to the category name at the top of the page.

Once you are satisfied that it works you can then check out what kind of URL rewrites that category has. In back end, go to: Catalog -> URL Rewrite Management. Type in the following in the ID Path column filter:

category/$CATEGORY_ID

(Where $CATEGORY_ID must be replaced with the category ID you used earlier)

You should then see at least one row with the following columns:

  1. ID
  2. Store View
  3. Type
  4. ID Path
  5. Request Path
  6. Target Path
  7. Options
  8. Action

The relevant information here is Request Path. Paste the value in that column directly after your base URL in your browser. Example: If Request Path is men.html then type the following address in your browser:

http://domain.com/men.html

Good luck.

Related Topic