How would you create a regular expression that would parse the following url
http://example.com/answers/38-my-example-question-on-regular-expression
Specifically, "/answers/38-my-example-question-on-regular-expression"
versus "/answers/category"
If the regex finds "38" a number, then it does this:
RewriteRule answers/([-_~*a-zA-Z0-9]+)(\/)?$ answers/view.php?title=$1&id=$2&%{QUERY_STRING}
else:
RewriteRule answers/([-_~*a-zA-Z0-9]+)(\/)?$ answers/categories.php?key=$1
I want to place the regex in the .httaccess for my webapp.
Thanks!