title: Need help with mod_rewrite conditions
body: <p>Probably a simple thing but I'm not sure what to do: I have this in my htaccess file so far</p>
  
  <pre><code>RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  #RewriteRule ^([^/]*)/?([^/]*)/?([^/]*)/?$  X.php?country=$1&amp;province=$2&amp;region=$3&amp;xxx=ZZZ [skip=1]
  RewriteRule ^([^/]*)/?([^/]*)/?([^/]*)/?([^/]*)/?([^/]*)/?([^/]*)/?$  defaultgg.php?country=$1&amp;province=$2&amp;region=$3&amp;category=$4&amp;type=$5&amp;prodid=$6 [L]
  </code></pre>
  
  <p>And it does the redirection well.  But now I need to add a  part that says to redirect to a different page if any of the last 3 parameters are set.  I tried the L and skip options but they don't seem to work to skip later rules so my final rule (shown above) always gets run.  </p>
  
  <p>The idea is if someone enters a url like so <a href="http://dddd.com/ca/on/peel" rel="nofollow">http://dddd.com/ca/on/peel</a>
  then they go to defaultgg...  as shown.</p>
  
  <p>ELSE  if someone enters a url like so <a href="http://dddd.com/ca/on/peel/veggies/tomatoes" rel="nofollow">http://dddd.com/ca/on/peel/veggies/tomatoes</a>
  then they go to a page X listing all tomatoes in the city of Peel.</p>
  
  <p>Else -- if someone enters a url like so <a href="http://dddd.com/ca/on/peel/veggies/any" rel="nofollow">http://dddd.com/ca/on/peel/veggies/any</a>
  then they go to a page Y listing all veggies in the city of Peel.</p>
  
  <p>Else -- if someone enters a url like so <a href="http://dddd.com/ca/on/peel/veggies/prodid" rel="nofollow">http://dddd.com/ca/on/peel/veggies/prodid</a>
  then they go to a page Y list details of prod with prodid found in veggies in Peel.</p>
  
  <p>How do I set the rules?</p>
  
  <p>Thanks</p>
  
  <p>PS: Else -- if someone enters a url like so <a href="http://dddd.com/ca/on/peel/veggies" rel="nofollow">http://dddd.com/ca/on/peel/veggies</a>
  then they go to a page defaultgg as above with categories set to "veggies", so generally then the use of the keyword "any" in the url for the 4th, 5th or 6th url folders will cause a search to be done in script Y, but leaving one off entirely will direct towards defaultgg. 
  I suppose use of the word "any" could trigger a search if it occurs anywhere in the url as a folder.</p>