First, please allow me to comment on your mod_rewrite code:
RewriteEngine on
RewriteRule ^location/([0-9-]*).html$ locate.php?a=$1 [L,NC]
That allows location/.html so the first question is whether locate.php can handle a null entry.
The second question is whether it can handle location/-.html, too.
The third question is WHY you’re using the No Case flag on a {REQUEST_URI} variable. Please understand that it would cause LoCaTiOn/.HtMl to match and, while that may not cause a problem with $1 (that wasn’t mentioned above), it’s completely and totally inappropriate. Having said, that, though, if you ever try to match the {HTTP_HOST} variable which is NOT case sensitive, that’s where you (logically) MUST use the No Case flag.
My preferred version of your code would be:
RewriteEngine on
RewriteRule ^location/([0-9-]+).html$ locate.php?a=$1 [L]
OR
RewriteRule ^location/([0-9]+(-[0-9]+)*).html$ locate.php?a=$1 [L]
which would require at least one digit then zero or more -digit sets.
As for creating “loopy code” redirecting from the actual link to your NEW FORMAT then back to the actual link, I’ll let you read the tutorial article linked in my signature for the code. Of course, if you still have problems, post what you have and I’ll help you get to the solution.
Sorry, I do this to prevent having script kiddies come and ask for free coding … and to be sure SitePoint members actually learn something so they can help others in the future.