htaccess redirect question

Discussion in 'Programming' started by DaveS, Jun 21, 2009.

  1. #1
    I have a SEO problem on my website that the site suppliers are looking at - I'm not sure if they will fix it for me though

    The problem is there are 2 URLS from each product:

    If you access product from the site homepage or site search you get:

    http://www.domain.com/products/widget.html

    if you navigate through the categories you get:

    http://www.domain.com/products/category-name/widget.html

    So, my question is: Can I rewrite the second URL to drop the category name, and if so, how do I do it?

    Also, what about where the product is a few categories deep, eg.


    http://www.domain.com/products/category-name/sub-category/widget.html


    Any help much appreciated.

    Dave
     
    DaveS, Jun 21, 2009 IP
  2. DaveS

    DaveS Peon

    Messages:
    39
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Sorry, just realised this is the wrong forum, should have been in the site and sever admin...
     
    DaveS, Jun 21, 2009 IP
  3. nirajkum

    nirajkum Active Member

    Messages:
    815
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    58
    #3
    in the second page use the redirect(first_url) that will redirect the second page to the first ...
     
    nirajkum, Jun 22, 2009 IP
  4. DaveS

    DaveS Peon

    Messages:
    39
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Thanks for that, is there any way to set it up so it works site wide (ie. so I don't have to create a new .htaccess entry for every product?)
     
    DaveS, Jun 22, 2009 IP