views:

5

answers:

1

the below code works to deal with my url structures but i need the rules not to work if there is parameter q= in the url.

i tried to set up a rewritecond (in the commented out line below) without success,

please help! thanks :)

Options +FollowSymlinks
RewriteEngine on

# RewriteCond %{QUERY_STRING} q!=(.*)
RewriteRule ^FSD/([^/]+)/([^/]+)/ /index.php?service=$1&type=FSD [NC]
RewriteRule ^ECD/([^/]+)/([^/]+)/ /index.php?service=$1&type=ECD [NC]
RewriteRule ^([^/]+)/([^/]+)/ /index.php?category=$1&subcategory=$2 [NC]
RewriteRule ^([^/]+)/ /index.php?category=$1 [NC]
+1  A: 

Your RewriteCond's test pattern is a little off, but you got the right idea:

RewriteCond %{QUERY_STRING} !(\A|&)q=.*

Note that the RewriteCond only applies to the next RewriteRule, so if you want to perform this exclusion for all four of your rules, you'll need to copy the RewriteCond above each of them.

Tim Stone
perfect - thanks!
significance