I maintain a website that contains a dozen or so .html documents which I have just rewritten to include php code. As search engines currently index the .html documents, I would rather not break those links and I certainly don't want to do anything that will affect my search rankings. I understand I have a couple of choices.
Option 1 is to replace all the .html extensions on my documents with .php, and then update .htaccess so that requests for .html documents are rewritten/redirected to the corresponding .php documents (as suggested here).
If I want to make this a permanent (301) redirection, so that the search engine links are replaced the next time my site is crawled, is this the correct way to do this?
RewriteEngine On
RewriteRule ^(.*)\.html$ $1.php [L,R301]
Option 2 would be to instruct the webserver to send all html documents through the php parser (as suggested here), which means the .html extension on the the files doesn't need to be changed at all:
AddType application/x-httpd-php .htm .html
So I see two viable choices. Is one better than the other (or can you think of a better one)?