I have hundreds of pages .html in my local folder and I want to convert them to .php.
Is there any way to do this in a single shot instead of going to replace every ".html" with ".php"
I have hundreds of pages .html in my local folder and I want to convert them to .php.
Is there any way to do this in a single shot instead of going to replace every ".html" with ".php"
In Windows you can start a command prompt (cmd), cd
to the right directory, and use this command:
ren *.html *.php
Or, without using cd
, use this command:
ren C:\Path\To\Your\Files\*.html *.php
*
is a wildcard which you can use to refer to all files. Windows supports using these wildcards too when renaming files in bulk.
Note: Make a copy first or make sure everything is committed in your version control. If things go wrong you would want to be able to restore the situation when you do a bulk action like this.
if you have access to .htaccess
and don't want to change the .html
to .php
manually. add this to your .htaccess
AddHandler application/x-httpd-php .html .htm
this will treat your .html
files as .php