Change .php extension

Hi all ,

is there any way to change the “.php” files entensions to ‘.xxx’ or to ‘.aspx’

if it’s possible how can change it in apache and IIS

many thanks

If you just wish to change the extensions for your files once and for good, you can simply use notepad++ to rename the files. Choose ‘save as’ and set the file type to ‘all’, then enter the file name followed by ‘.xxx’ or ‘.aspx’ to accomplish this task. If you want the extension to be changed dynamically on the server, I am not sure if this is possible.

I want the server to run the “.xxx” pages for example . my home page to be

index.xxx instead index.php

In Apache you can add a handler to process files of any extension as PHP. So if you want PHP to process files with an extension of .xxx, you can add a line to your .htaccess file or to the server configuration file.

AddHandler application/x-httpd-php .php .xxx .aspx

Files with extensions of .php, .aspx, and .xxx will be treated as PHP code. Add as many file extensions as you need. I have no idea about IIS.

And for your home page to be index.xxx, you should set DirectoryIndex to display index.xxx when no file is requested such as when only the domain name is entered into the address bar. In .htaccess or server configuration file:

DirectoryIndex index.xxx

index.xxx will be displayed as your default page when the domain name is requested.