I have the following regex:
RewriteRule ^blogs/([^/]*)/([^/]*) blogs/index.php?blogger=$1&blog=$2
This works fine for the following cases:
- http://myurl.com/blogs/blog-name/blog-article/
- http://myurl.com/blogs/blog-name/blog-article
- http://myurl.com/blogs/blog-name/
however it does not handle:
How can I make the "/" separator optional in this regex?
I'd use:
And you'd just have to check and make sure that
$2
is still correct (with the two capture groups, it might be$3
… I can't remember).If the '?' is causing troubles then try: