views:

235

answers:

0

Hi,

I have the following in my .htaccess file:

php_flag magic_quotes_gpc off
Options +FollowSymlinks 
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME}   !-s
RewriteRule ^admin(.*)$ admin/index.php [L]
RewriteCond %{REQUEST_FILENAME}   !-s
RewriteCond %{REQUEST_FILENAME}   !-d
RewriteRule .* index.php [L,QSA]

The idea is to fetch the entire URL into index.php, e.g. http://site.com/page1/page2/3928

index.php would then explode the uri 'page1/page2/3928' into three parts

page1/page2 list all the products (i.e. if $uri[2] is not set, then list all products). This works fine.

page1/page2/3928 is supposed to present product detail, which it does, but for some reason it also runs the query for product listing (page1/page2) not only once but several times.

When I click on page1/page2/3928, mysqyl shows me several instances of product listing query which shouldn't be running at all.

My guess is that /page1/page2/3928 is also internally redirecting about 10 times to /page1 as well.

The rewrite log file show many instances of the following:

127.0.0.1 - - [25/Jan/2010:02:44:58 +0000] [site/sid#1656600][rid#28e14c8/initial] (2) [perdir C:/xampp/htdocs/site/public_html/] trying to replace prefix C:/xampp/htdocs/site/public_html/ with /
127.0.0.1 - - [25/Jan/2010:02:44:58 +0000] [site/sid#1656600][rid#28e14c8/initial] (1) [perdir C:/xampp/htdocs/site/public_html/] internal redirect with /index.php [INTERNAL REDIRECT]
127.0.0.1 - - [25/Jan/2010:02:44:58 +0000] [site/sid#1656600][rid#2c53088/initial/redir#1] (3) [perdir C:/xampp/htdocs/site/public_html/] strip per-dir prefix: C:/xampp/htdocs/site/public_html/index.php -> index.php
127.0.0.1 - - [25/Jan/2010:02:44:58 +0000] [site/sid#1656600][rid#2c53088/initial/redir#1] (3) [perdir C:/xampp/htdocs/site/public_html/] applying pattern '(.*)' to uri 'index.php'
127.0.0.1 - - [25/Jan/2010:02:44:58 +0000] [site/sid#1656600][rid#2c53088/initial/redir#1] (3) [perdir C:/xampp/htdocs/site/public_html/] strip per-dir prefix: C:/xampp/htdocs/site/public_html/index.php -> index.php
127.0.0.1 - - [25/Jan/2010:02:44:58 +0000] [site/sid#1656600][rid#2c53088/initial/redir#1] (3) [perdir C:/xampp/htdocs/site/public_html/] applying pattern '^(.+)$' to uri 'index.php'
127.0.0.1 - - [25/Jan/2010:02:44:58 +0000] [site/sid#1656600][rid#2c53088/initial/redir#1] (1) [perdir C:/xampp/htdocs/site/public_html/] pass through C:/xampp/htdocs/site/public_html/index.php

Any help will be appreciated.

Many thanks!