---- permanent redirect from dynamic to static 301
lucy24 - 8:49 pm on Apr 13, 2013 (gmt 0)
Coming in late here (different time zone):
can you use this code for a page that does not exist?
YES, absolutely, in fact that's what rewrites are all about. The server does not even look for the file until all the apache mods have done their stuff and it's time to serve up the page. (Bizarrely, this is true even when a rule is inside a <Files> or <FilesMatch> envelope. The file itself doesn't have to exist-- only its putative directory.)
Well, I created a new empty .htaccess
Uh-oh. Is this new htaccess instead of or in addition to other htaccess files in other directories either above or below the one you're working on (side-by-side doesn't matter)? mod_rewrite behaves differently from all other Apache mods in a number of ways. One of those ways is that a RewriteRule in a later htaccess-- or inside <Files> in the same htaccess-- will make the effects of any earlier RewriteRules disappear, exactly as if they never existed.
The new htaccess can't possibly be the only one you've got. Somewhere along the line you mentioned WordPress. Like any CMS you can name, it won't do its stuff without a whole set of RewriteRules of its own. So either there is a separate htaccess you've overlooked-- or you've overwritten the WordPress htaccess.
Redirects are easier to test than rewrites. You don't even need LiveHeaders or similar; you will see your browser's address bar changing. Or not changing.