I've been struggling to redirect to two different urls (files) based on what is in the path of the calling url, ie:
example.com/rh/xxxxx/ -> user.php?a=xxxxx
example.com/rh/xxxxx/yyyyy/ -> record.php?a=xxxxx&b=yyyyy
Here's what I have so far, and it's not working.
RewriteCond %{REQUEST_URI} ^/rh/[^/]*/[^/]*/?$ [NC]
RewriteRule ^/rh/([^/]*)/([^/]*)/?$ record.php?a=$1&b=$2 [L,NC]
RewriteCond %{REQUEST_URI} ^/rh/[^/]*/?$ [NC]
RewriteRule ^/rh/([^/]*)/?$ user.php?a=$1 [L,NC]
Any help is much appreciated. Thanks
With your shown samples please try following .htaccess rules file. Please make sure to keep your .htaccess rules files along with
record.phpanduser.php.Make sure to clear your browser cache before testing your URLs.