#1
  1. No Profile Picture
    Contributing User
    SEO Chat Explorer (0 - 99 posts)

    Join Date
    Aug 2004
    Location
    North Italy
    Posts
    55
    Rep Power
    15

    dynamic to static - mod_rewrite multiple queries problem


    Hello, i posted this in Scripts forum but no reply. Question is related to SEO optimization so hope i will not be punished for this copy 3d.

    I did this:

    www.domain.com/search.php?q=seo

    and now it looks like this:

    www.domain.com/search/seo.html

    and it's works fine.

    My problem is that every request produces 3 queries to db. Maybe bcoz i have this in my .htaccess (in folder /search/)

    Code:
    RewriteEngine On
    RewriteBase /
    RewriteRule ^([^/]+)_([a-z0-9]+)_([a-z0-9]+)\.html$ /search.php?q=$1&option=$2&start=$3 [QSA]
    RewriteRule ^([^/]+)_([a-z0-9]+)\.html$ /search.php?q=$1&start=$2 [QSA]
    RewriteRule ^([^/]+)\.html$ /search.php?q=$1 [QSA]
    I think i need some IF operator but dont know how to use it with .htaccess

    How i can fix this? I have page which shows last 20 queries and this problem fills very quickly with same keyword

    Any help will be appreciated.
    Thank you!

    P.S. Sorry for my bad eng. - im italian
  2. #2
  3. No Profile Picture
    Contributing User
    SEO Chat Discoverer (100 - 499 posts)

    Join Date
    Jun 2004
    Location
    Texas
    Posts
    187
    Rep Power
    16
    Originally Posted by grin

    I think i need some IF operator but dont know how to use it with .htaccess
    I don't believe there is any way to utilze if operators in .htaccess files.
  4. #3
  5. No Profile Picture
    Contributing User
    SEO Chat Explorer (0 - 99 posts)

    Join Date
    Aug 2004
    Location
    North Italy
    Posts
    55
    Rep Power
    15
    there must be something Rule.. if one of rules is passed stop to aplly rules.. I see something on this forum but can't find it :-(
  6. #4
  7. Canine
    SEO Chat Discoverer (100 - 499 posts)

    Join Date
    Aug 2004
    Location
    Indian Trail, NC
    Posts
    210
    Rep Power
    15
    Have you tried RewriteCond ? You can have multiple RewriteCond statements evaluated before your RewriteRule, and that can form a sort of IF logic.
  8. #5
  9. Contributing User
    SEO Chat Discoverer (100 - 499 posts)

    Join Date
    Aug 2004
    Posts
    176
    Rep Power
    15
    Are you using option QSA in case a session ID is passed as a query string? I think what you want to do is add the L option so if it matches on a particular pattern it will not go to the next pattern, ie [L,QSA]

Similar Threads

  1. dynamic pages or better static pages
    By semo in forum Google Optimization
    Replies: 10
    Last Post: Dec 29th, 2004, 08:43 AM
  2. dynamic to static - mod_rewrite multiple queries problem
    By grin in forum Web Design, Coding and Programming
    Replies: 2
    Last Post: Sep 7th, 2004, 06:54 AM
  3. Dynamic to static URL: Does Google index directories?
    By ldelgado in forum Google Optimization
    Replies: 2
    Last Post: Jul 21st, 2004, 12:27 PM
  4. how 2 optimize static n dynamic pages.....
    By vishal in forum Search Engine Optimization
    Replies: 3
    Last Post: Apr 22nd, 2003, 12:56 PM
  5. Googlebot dynamic URL problem
    By knipper in forum Google Optimization
    Replies: 7
    Last Post: Apr 15th, 2003, 03:33 PM

IMN logo majestic logo threadwatch logo seochat tools logo