Hi! New to this site, but I've been struggling with this for a few weeks. I have changed my site from html to wordpress php. Getting a lot of 404's as the redirects are not going where i need them to. This is what I currently have in my htaccess file.
By itself, the boilerplate code doesn't redirect anything. It simply says "If the request is for anything at all whatsoever that doesn't physically exist on the server, dump the problem on index.php and let it deal with things".
You need two things. No, three things, because before anything else you're going to get rid of that <IfModule envelope. Not its contents, just the envelope itself. An <IfModule envelope is never needed in a specific individual htaccess file: you've either got the mod or you haven't. And the envelope is doubly or multiply ridiculous when it pertains to mod_rewrite and any rewrite-based CMS :)
FIRST you need to redirect any existing URLs to the desired new form. THEN you need to rewrite those new URLs to serve content from wherever the content lives-- in this case, apparently index.php.
Oops, and a fourth part: You need to make sure your brand-new index.php WordPress page knows how to deal with the old URLs. You can't assume that a CMS-- of any kind-- knows how to handle pages it didn't create itself.
Now, about those 404s. If that really is your entire htaccess, then no redirect is taking place. So the 404 means that, first, the old pages don't physically exist-- at least not in the location where the server is looking-- and the index.php page doesn't know how to deal with a request for "page2.html". That's actually not an htaccess/mod_rewrite issue but a WordPress issue.
And a fifth thing. Putter around this subforum a bit and you'll find lots of long boring lectures on why nobody is going to write your code for you. But we'll hold your hand as you work your way through it.
The Library [webmasterworld.com] is actually a great place to find the info you're looking for. There's a few tutorials for beginners in there near the bottom of the page that should walk you through understanding how to construct your own basic rules.