mod_rewrite questions

Discussion in 'Search Engine Optimization' started by Mike1958, Aug 14, 2005.

  1. #1
    Hi all,

    Thanks for the information everyone has shared in this forum!! I'm not completely sure what questions to ask here so I was wondering if a few people familiar with mod_rewrite could take a look at the recipe section of my site @ http://www.egourmetstore.com . The entire recipe section is done dynamically with PHP. Was wondering if I would benefit from using mod_rewrite and if so would I use two different rules (1) one to rewrite the url to the recipe category and (2) one to rewite the url to the recipe it self?

    thanks all,
    Mike
     
    Mike1958, Aug 14, 2005 IP
  2. Willy

    Willy Peon

    Messages:
    281
    Likes Received:
    25
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Hiya Mike,

    I checked out your site and yes, the recipes section could certainly benefit from mod_rewrite. Rewriting the recipe category is trivial; however, in order to be able to easily rewrite the recipe itself, you'll need to first change the recipe lookup from using the recipe ID to using the recipe title, as follows.

    Instead of:
    http://egourmetstore.com/gourmet/cookbook/viewrecipe.php?id=152&category=Turkey
    ...do this:
    http://egourmetstore.com/gourmet/co...ory=Turkey&title=Apple+Cinnamon+Glazed+Turkey

    After that, the necessary rewrite rules are not going to be difficult and will let you have URLs of the form:
    http://egourmetstore.com/gourmet/cookbook/recipes/Turkey/Apple+Cinnamon+Glazed+Turkey/

    ...which will certainly help your search engine friendliness.
     
    Willy, Aug 14, 2005 IP
  3. Mike1958

    Mike1958 Peon

    Messages:
    238
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Hi Willy,

    Thanks for looking at my site and providing feed back. Sounds like I should start with mod_rewrite of the categories and then plan an approach for the actual recipe pages.

    I wonder..is there any chance the search engine bots/spiders could follow my dynamic links....or is that too much to hope for.

    Thanks again,
    Mike
     
    Mike1958, Aug 14, 2005 IP
  4. Mike1958

    Mike1958 Peon

    Messages:
    238
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Quick question for anyone who may be viewing. If I use mod_rewrite to change a url, should that change be refected in the address bar? Or will the original url be there?

    thanks,
    Mike
     
    Mike1958, Aug 14, 2005 IP
  5. dct

    dct Finder of cool gadgets

    Messages:
    3,132
    Likes Received:
    328
    Best Answers:
    0
    Trophy Points:
    230
    #5
    The address bar will show the version before the mod rewrite is applied (i.e. the SEF one)
     
    dct, Aug 14, 2005 IP
  6. Mike1958

    Mike1958 Peon

    Messages:
    238
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Thanks dct - if I'm using mod_rewrite to change a dynamic url to a static url...is there anyway for me to verify it actually changed since the content will be the same. Wonder if its logged somewhere? I suppose I could temporarily modify the page to echo the url. anyone have ideas?

    Thanks,
    Mike
     
    Mike1958, Aug 14, 2005 IP