Msg#: 3977584 posted 3:33 pm on Aug 24, 2009 (gmt 0)
Get rid of unnecessary back-references and make your rule as specific as possible for the sake of efficiency: RewriteRule ^([0-9A-Za-z]+)/comment-page-[0-9]+(.*)$ http://www.example.com/$1/$2 [R=301,L]
However, be aware that this is not the 'solution' to your problem. It will only be useful to add this rule after fixing the root cause, which is that your WP installation (or a plug-in) is *defining* these incorrect URLs on the Web by publishing them on your pages. Once the URLs appear on your page where users and search engines can see them, no amount of mod_rewrite code is going to fix that; The act of publishing a URL in a link is what 'defines' that URL for the world, and the only use for this mod_rewrite rule will be to speed up the cleanup of search engine listings once the root cause of the problem is fixed and your site starts publishing correct URLs.
There are a couple of tutorials about what mod_rewrite can and can't do for you in our Apache Forum Library here at WebmasterWorld if you'd like to read more details.
[edited by: jdMorgan at 4:25 pm (utc) on Aug. 24, 2009]
Msg#: 3977584 posted 3:58 pm on Aug 24, 2009 (gmt 0)
Jim, thanks for the clean-up.
Point taken regarding fixing the source of the problem. In this instance there's not much I can do about it without editing a WordPress core file, which will be over-written with each upgrade. Fortunately I have very few 'problem' links and those I do have appeared only yesterday.
And yes, over the years I've received a lot of assistance with .htaccess both from you and from the Apache Forum Library. The trouble is, I dip into mod_rewrite only every now and then, and my understanding of what I've done fades with time.