Welcome, Guest
  • Author Topic: Help - Trying rewrite_mod to create SE friendly URLs  (Read 5250 times)

    Adam

    • Jr. Programmer
    • **
    • Posts: 96
      • View Profile
      • Email
    I've read a number of articles saying that search engines have trouble picking up query strings. I don't know if search engines have become better at this but I thought I would play it safe and try to make the URLs more search engine friendly. Several articles talk about using the rewrite module in apache, but it seems that module has trouble in apache 2. Here's what I have so far...

    Test server WindowsXP and Apache2:

    In httpd.conf

    LoadModule rewrite_module modules/mod_rewrite.so
    #comment removed from above
    AllowOverride All
    #above changed from None to All

    In .htaccess

    Options +FollowSymlinks
    RewriteEngine on
    RewriteRule ^(.*)\.htm$ $1.php [nc]

    The above rewrite rule should take any htm or html call and redirect it to a php page with the same name. I can't get it to work. I tested a Redirect in the .htaccess file and it worked, but apache is ignoring the rewrite stuff completely.

    First question - Is this really necessary? Do the search engines really falter on query strings or are they now better at it? It seems that everyone with dynamic pages would really be worried about this problem if it was as bad as some of the articles make it sound.

    Second question - If it is that bad, how do you get the rewrite module to work?

    Thanks all,
    Adam

    Musicman

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 2685
      • View Profile
      • Email
    Hi,

    Google is happily indexing a site for me, with almost everything a
    /cgi-bin/search.cgi?prod_id=4711
    style code.
    Also, for friendly names, you should probably not just replace html by php, but redirect all names to one single php, with the name appended.
    There is a drawback with "friendly names", too: I came across a site that had links like
    order_this_product_4711.html
    probably also an attempt at improving SE. Now the only part of importance was the product id in the name. So consider a malevolent site puts up a link like
    buy_this_crap_4711.html
    in some public area and waits for google to find it ....

    Musicman