mod_rewrite issue

Discussion in 'Search Engine Optimization' started by subzero27, Aug 2, 2007.

  1. #1
    Hello all,

    I have a site that has url's something like theis -
    abcd.domain.ro/category.php?id=subzero

    i did a mod rewrite and converted the dynamic pages to static to make it seo friendly .i wanted the pages to end with a .html extension ( my original pages are in php).So i used teh accecptpathinfo() directive to force the php files to be displayed as html.

    this didn't work as i have apache 1.37 version installed and accecptpathinfo () is supported by apache 2.0 and above.

    So i just made simple rewrite with the code like this -
    RewriteEngine On
    RewriteRule ^(.*)-([0-9]+).html$ category.php?id=$2

    will this work ? plus do i have to update the links as well or the search engines will automatically index the static pages by following the parameters in the .htaccess file.

    thanks for your time.
     
    subzero27, Aug 2, 2007 IP
  2. trichnosis

    trichnosis Prominent Member

    Messages:
    13,785
    Likes Received:
    333
    Best Answers:
    0
    Trophy Points:
    300
    #2
    there is a .htaccess faq thread under dp Apache forum. it's a sticky thread. did you check it?
     
    trichnosis, Aug 2, 2007 IP
  3. subzero27

    subzero27 Peon

    Messages:
    42
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Yes i had checked it...but i didn't find the specific answer
     
    subzero27, Aug 2, 2007 IP
  4. mymaldives

    mymaldives Well-Known Member

    Messages:
    153
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    108
    #4
    Try this one

    RewriteEngine On
    RewriteRule ^([^/]*)\.html$ /category.php?id=$1 [L]

    it should look like
    http://abcd.domain.ro/subzero.html
     
    mymaldives, Aug 2, 2007 IP
  5. subzero27

    subzero27 Peon

    Messages:
    42
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    will using [301,L] help me in any ways ? plus do i need to update my links as well or spiders will automatically find my new links and index it as per the parameters in the .htaccess file.
     
    subzero27, Aug 3, 2007 IP