Please help, I'm going crazy!
RewriteRule ^([a-z0-9_-]+)?/?search/?$ search.php?id=$1&%{QUERY_STRING} [NC,L]
This is my current code. Sometimes people will visit mysite.com/search, other times they will visit mysite.com/boris/search and I detect a user with an empty($_GET['id']) check.
However I am creating another search, mysite.com/products/search which leads to products_search.php
I need my original RewriteRule to match any user EXCEPT the word 'products'.
I have tried so many combinations.
RewriteRule ^(!products&[a-z0-9_-]+)?/?search/?$ search.php?id=$1&%{QUERY_STRING} [NC,L]
I'm not very good with regex/mod_rewrite but I something like the above should work? I just need an AND operator as clearly & doesn't work, but I can't find one!
Many thanks in advance.