#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 guys, i did this:

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

    becomes 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]
    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
    Hoster Poster
    SEO Chat Discoverer (100 - 499 posts)

    Join Date
    Jul 2004
    Location
    Toronto, Canada
    Posts
    162
    Rep Power
    15
    why are you doing that?
    Search engines will have no problem indexing that url string
  4. #3
  5. No Profile Picture
    Posts: 20, 574 (I wish!)
    SEO Chat Adventurer (500 - 999 posts)

    Join Date
    Jun 2004
    Posts
    764
    Rep Power
    15
    Originally Posted by grin
    Hello guys, i did this:

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

    becomes 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]
    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
    I agree with cyanide,

    I guess the below code will work:
    RewriteEngine On
    RewriteBase /
    RewriteRule ^([^/]+)\.html$ /search.php?q=$1 [QSA]

    but then you couldn't have the options

    Dan

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 URL: Does Google index directories?
    By ldelgado in forum Google Optimization
    Replies: 2
    Last Post: Jul 21st, 2004, 12:27 PM
  3. how 2 optimize static n dynamic pages.....
    By vishal in forum Search Engine Optimization
    Replies: 3
    Last Post: Apr 22nd, 2003, 12:56 PM
  4. 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