Debugging permalink issue

OK fixed it!

I had some errant lines in the .htaccess file:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# WP REWRITE LOOP END

This was taking precedence over the <IfModule mod_rewrite.c> block – and explains why it was redirecting to the parent directory.

(The lesson here is if you are asking for questions about .htaccess, it is probably good to post the whole .htaccess file rather than just a snippet!)