SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict
    Join Date
    Sep 2005
    Posts
    335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    What is the best SEF URL layout?

    My application has products and categories. I'm currently writing the SEF URL module. What is the best way to lay out the SEF URL? Here are some examples:

    (12 = categoryid, 35 = productid on all below examples)

    1. domain.com/12/35/product-name.php
    2. domain.com/12/35/product-name
    3. domain.com/12/35/product-name/
    4. domain.com/product-name/12/35
    5. domain.com/category-name/12/product-name/35
    6. domain.com/category-name/product-name/12/25

    I need the categoryid and the productid so I can find the product and category.

    Should I try to stuff the category name in to the URL as well as the product name or is that just too much text?

    Should I put the category name and/or product name closer to the domain name or does it not matter?

    Is it better to have the last entry a file or a directory (as in option 1 vs. option 2)?

    I appreciate any advice or links you can provide.

    Thanks
    PHP Shopping Cart Software Easy Ecommerce Shopping Cart Script.
    PHP Super Cart is 100% template driven.

  2. #2
    SitePoint Guru
    Join Date
    May 2004
    Location
    santa rosa, ca
    Posts
    969
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Probably number 2 simply because that is the shortest of your options and short urls make for SEF urls.
    nondenominational, noncommercial, nonprofit,
    listener-supported, 24-hour, Christian ministry:
    Listen Live Online

  3. #3
    I am Learning... Vick!'s Avatar
    Join Date
    Oct 2005
    Posts
    633
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    IMO best url is domain.com/category-name/product-name/

    But if you must include category and product ID, use this:
    domain.com/category-name/12/product-name/35/

    And its better to end URL with directory name, simillar thread is here:
    http://www.sitepoint.com/forums/showthread.php?t=442513

    Good luck.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •