in my case wordpress has its own little .htaccess file - should code i write go above or below that?
You should put each rule where it logically belongs, regardless of who wrote it or when it was added.
Within the past couple of days I posted a pretty detailed explanation of how RewriteRules should be ordered
which I now can't find, so possibly it wasn't in /apache/ as I thought* so I won't repeat it here. Short version: lockouts before redirects, redirects before rewrites.
Unless you are absolutely certain you know what you are doing, do not repeat DO NOT put RewriteRules in more than one htaccess file on the same path. That is:
(a)
/directory/.htaccess
(b)
/directory/subdir1/.htaccess
/directory/subdir2/.htaccess
You can EITHER put RewriteRules in (a) only, OR put them in one or both of (b). And, in the second case, "both" is only safe if /subdir1/ and /subdir2/ never redirect or rewrite to each other.
* Punch line: The whole time I was going bonkers with site search looking for everything under the sun-- and utterly failing to find it--
the very post I was searching for was open in the immediately adjacent tab:
[
webmasterworld.com...]
memo to self: there is only one "t" in "highlight"