I have a htaccess file which grabs pretty much anything after the / sign and gives it to my index.php?i. This works perfectly but I want to take it one step closer and have the same htaccess use conditions. Currently this is the navigation method mysite.com/stuff/cat the htaccess simply grabs the string stuff/cat and my PHP can then load up contents about it. But what I want to do is: when the navigation is mysite.com/stuff/cat/images I want the htaccess to redirect to another file rather than my index.php. Is it possible to add some kind of If statement or condition in htaccess? (if string contains 'images' redirect to gallery.php?i=data)
here is my current code:
RewriteEngine On
RewriteOptions inherit
RewriteRule ^([a-zA-Z0-9/_\s'-()]+)$ index.php?i=$1