My site uses a URL structure like below
example.com/CATEGORY/CITYNAME/TITLE/ID/
However sometimes the content might not have the category defined so would just be
example.com/CITY/TITLE/ID/
In my .htaccess I have
RewriteRule ^([^/\.]+)/([^/\.]+)/([^/\.]+)?$ page.php?jobid=$3
RewriteRule ^([^/\.]+)/([^/\.]+)/([^/\.]+)/([^/\.]+)?$ page.php?jobid=$4
This works fine with or without the category I have an autocomplete textinput on the category page which adds the cityname to the URL In the .htaccess I have
RewriteRule ^warehouse-jobs$ catpage.php?id=10&kw=Warehouse&base=warehouse-jobs [L,NC]
RewriteRule ^.+/([^/]*)/$ catpage.php?id=10&kw=Warehouse&base=warehouse-jobs&loc=$1 [L]
So this will redirect the category without the city defined to the catpage ( which works ) But as soon as the city is added (2nd redirect rule ) it redirects to the domain root for some reason
I know I'm doing something wrong but I can't figure out what or how to remedy it Any advice would be very much appreciated