3

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"

Himani Trivedi
  • 158
  • 2
  • 3
  • 16
Saleem Ahmed
  • 240
  • 2
  • 12

2 Answers2

6

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.

GolezTrol
  • 114,394
  • 18
  • 182
  • 210
3

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

roullie
  • 2,830
  • 16
  • 26