selliottsxm Posted April 16, 2014 Share Posted April 16, 2014 Hello Can someone verify for me that it's possible to edit the .htaccess file making it possible for a page with the extension of .cfm to be treated as a php file? For example: AddType application/x-httpd-php .php .htm .html .cfm Will that work ok? Thanks in advance, Steve Link to comment Share on other sites More sharing options...
HartleySan Posted April 16, 2014 Share Posted April 16, 2014 Can you please give us an example of a .cfm URL that someone would go to and what you want to transform that to? Thanks. Link to comment Share on other sites More sharing options...
selliottsxm Posted April 16, 2014 Author Share Posted April 16, 2014 I'm rewriting a site that uses a join script with the extension of .cfm The url has variables that the script uses in adding a user after a succsessful purchase. Instead of trying a redirect to a php page I thought it might be easier for the server to treat the cfm extension as php. Link to comment Share on other sites More sharing options...
HartleySan Posted April 16, 2014 Share Posted April 16, 2014 That's not how .htaccess files work. You can code an .htaccess file to redirect from one URL path to another, but you can't make the Apache server treat a ColdFusion file like a PHP file. Sorry. Link to comment Share on other sites More sharing options...
Larry Posted April 17, 2014 Share Posted April 17, 2014 Are you sure, HartleySan? I think you can. Because you can tell Apache to treat .html as PHP. Why couldn't you tell it to treat .cfm as PHP? I'm not positive myself, but I feel pretty confident of it. Link to comment Share on other sites More sharing options...
Larry Posted April 17, 2014 Share Posted April 17, 2014 That being said, if the file really is ColdFusion code, then just telling the server to send that file through the PHP module won't do any good. Link to comment Share on other sites More sharing options...
HartleySan Posted April 17, 2014 Share Posted April 17, 2014 Yes, Larry, I believe you are right. Sorry about that, Steve. I think you're also right though Larry in that it wouldn't do you much good to run a ColdFusion file through PHP anyway. Link to comment Share on other sites More sharing options...
selliottsxm Posted April 28, 2014 Author Share Posted April 28, 2014 Hey Guys, Thanks for the comments I really appreciate it. I'll let you know how we handled it when we get around the installing the new site. Currently we are passing values from a .cfm script to a php script. I think it was handled by editing the Apache config file by way of a file handler statement. Steve Link to comment Share on other sites More sharing options...
Recommended Posts