The URL rewrite takes place when a resource (page, image, script) is requested, so
there is only one instance needed.
The original URL is in the following form:
I would like to make it:
The following *might* work to accomplish what you describe:
RewriteRule ^show_full.htm\?rec\=(.*)$ mathematics/$1.htm [R=301]
The first part of the rule is the initial pattern, the second part is the
desired result. Only one substitution is needed, thus only one (.*) - $n pair
Have you read the documentation on the Apache.org web site yet? There are two
long mod_rewrite documents there which are very helpful if you use them to
decode some of the examples you find here on WebmasterWorld.
Also should mention that the "\" character is used to escape certain characters
that have special meaning to the regular-expressions patten matching used by
mod_rewrite. In the rule above, I escaped both "?" and "=". "?" must be escaped
in this way - but not sure about "="; It won't hurt to precede it with "\"
The "[R=301]" at the end of the rule will make this a permanent redirect. Use
it for testing, as it will force your browser to refetch the page from the
rewritten address, and you will see the results of your rewriterule in your
browser's address bar. You can then remove it when you get things working.
Hope this helps.