views:

8

answers:

2
RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^([a-zA-Z0-9_-]+)\.html$ product.php?pid=$1&rewrite=1&%{QUERY_STRING} [L,QSA,NC]

RewriteCond %{REQUEST_FILENAME} !-f 

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^([a-zA-Z0-9_-]+)\.html$ product2.php?cid=$1&rewrite=1&%{QUERY_STRING} [L,QSA,NC]

RewriteCond %{REQUEST_FILENAME} !-f 

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^([a-zA-Z0-9_-]+)\.html$ product3.php?bid=$1&rewrite=1&%{QUERY_STRING} [L,QSA,NC]

Can't access product2.php or product3.php files...

Please help...

A: 

All of your RewriteRule regular expressions are the same, so it will only match the first time, transform the URL to product.php?pid=$1&rewrite=1&%{QUERY_STRING} [L,QSA,NC], and then do nothing else (The L flag specifies it won't match any more rules for that run, then after it rewrites the URL to product.php, product.php will not match any of the other rules on the next pass).

Additionally, there's no need to add &%{QUERY_STRING} if you pass the QSA flag, as this automatically appends the query string to the modified query string it gets from your RewriteRule.

I understand that you expect it to access those other two pages, but you'll need to describe what input URLs should map to each particular file for anyone to be able to help you further than this.

Tim Stone
A: 

Hello Tim,

Thanks for response...

Can you please suggest me, in case scenario how to tackle this code mentioned in .htaccess ..

Regards, HM

Hritik