I have a URL I want to shorten with a mod_rewrite.
In its ugliest form it looks like:
/img.php?i=15&a=92
Ideally it would look like:
/img/15/92
The problem is sometimes it might just be:
/img.php?i=15
In which case the person will enter:
/img/15
So I'm thinking I need a mod_rewrite like this:
RewriteRule ^/img/(.*)/(.*)$ /img.php?i=$1&a=$2
Which I imagine will work only when both variables are in the URL and not just the shortened version.
How do I make a single rewrite that works for both, or how do I make 2 without cancelling the other out?