.htaccess file code to rewrite .html to .php

Hello, I am trying to write a code to rewrite pages called .html to .php using a rewrite rule in the .htaccess file. Im new to the language used in the .htaccess so any help would be greatly appreciated. Many thanks.
SEDWEBAsked:
Who is Participating?
 
Brad HoweConnect With a Mentor DevOps ManagerCommented:
Try this in the directory required.

Options +FollowSymLinks
RewriteEngine On
RewriteRule ^(.*)\.html$ /$1.php [R=301,L]

Cheers,
Hades666
0
 
SEDWEBAuthor Commented:
The category should not be under Tax / Financial Software. My apologies.
0
 
Brad HoweDevOps ManagerCommented:
If this is only internal then use the following without the backslash (/). The first is for external/internal webapplications.

Options +FollowSymLinks
RewriteEngine On
RewriteRule ^(.*)\.html$ $1.php [R=301,L]

Cheers,
Hades666
0
 
SEDWEBAuthor Commented:
Managed to use this as a basis for the redirect. Many thanks.
0
All Courses

From novice to tech pro — start learning today.