views:

19

answers:

1

HI -

I have a site (built years ago) which uses .htm extension on most pages.

I'd like to switch to a Wordpress CMS and use the "html on pages" plugin to re-create the whole site, but then, of course, I would end up with html extensions on all my pages and lose all my search engine placement for the original .htm pages, many of which have first page placement in the SERPs.

What is the correct syntax for a mass 301 redirect that tells the bots that all pages which formerly used .htm extensions are now .html?

Thanks in advance for any help!

J.

+1  A: 

What web server are you using?

On Apache you might say:

RedirectMatch permanent ^(.*)\.htm$ /$1.html

(Aside: it's not just SEO! By keeping your old links alive and redirecting to the new ones, you keep incoming traffic and avoid annoying users with 404s.)

bobince
I presume it's apache - I'm on a VPS that uses WHM.
John
So that one line of code in my .htaccess would do the trick? Appreciate the input, and yes, in addition to SEO I want to keep the human visitors to the site happy while I move to a platform that is more flexible and allows me to change the look more easily.
John
WHM 11.26.20 CENTOS 5.2 i686 virtuozzo on server and yes, it's apache
John