Forwarding .html to .php?

Sarah R

New member
I have a website which many different directories, the site is quite old and as a result there are a mixture of pages with .php extension and some with .html

There are four directories as follows:-
mydomain.com/directory1
mydomain.com/directory1/directory2
mydomain.com/directory1/directory3
mydomain.com/directory1/directory4

Each of these directories contain approx 250 files with .html extension. I need to edit these pages and add some functionality which means that I need to change the extension to .php

Creating the new pages is not a problem. What Im getting stuck with is how to ensure that if anyone visits the site eg
mydomain.com/directory1/page17.html they automatically get forwarded to mydomain.com/directory1/page17.php

NB This needs to be set up to make both users and SE bots happy :-)

I am presuming I need to edit the .htaccess but the only way I know how is to add a separate line for every file (ie about 1000 lines).

Is there anyway to cut this down to a few lines.

Please remember that not ALL .html pages on the website need to be forwarded to .php only those in these four particular directories.

Any assistance would be gratefully accepted.

Many thanks.
Sarah
X
 
.php is a server language, .html is used to display pages on the users browser. The tags are not interchangeable, your pages will use both, not either
 
.php is a server language, .html is used to display pages on the users browser. The tags are not interchangeable, your pages will use both, not either
 
Back
Top