I'm not really strong on this stuff, so hopefully someone else will chime in to either back me up or correct me, but the second line you have will redirect a request for any URL on the old domain to the default URL (the home page) of the new domain.
There's an implied
wildcard in there, Bob, on both the target and the destination. Think of it as "redirect 301 /* http://www.newdomain.com/*
" and it might make more sense?
What I'm not sure about is whether any of the code that comes after that is going to make a difference.
Good eyes, Bob. All of the code, except for that second line, is commented out.
But I have a suspicion it's not working like a domain redirect should as with Google not having indexed any pages yet.
You can use a HTML head checker
to load the page and examine the return status code. If the code is a 301, as it should be, then you're good to go. Be sure to check more than just one or two pages and be particularly careful to check any dynamic pages that pass parameters in the URL.
In closing, you probably shouldn't confuse Google indexing a page (a spider visiting your site) with Google including your pages in its index. Those are two different things and are always
separated by a discrete chunk of time. Be patient.