Changing Charatcteristics of a File – Static to Dynamic

email

Did you know that you are able to change the characteristics of a static file such as a .html or .txt file to allow it to accept dynamic code such as php or asp?  Well you can, here’s how…

Lets say you’re looking to create a dynamic .csv  or .txt for a shopping feed for one of the shopping comparison search engines such as Shopping.com, normally, you would not be able to do so because .xml/.txt/.csv files are static and would not ordinalrily execute php commands to output the products from a database. 

The solution…

Place the following code in your .htaccess file:

<Files filename.csv>
ForceType application/x-httpd-php
</Files>

That should do the trick.  Change “filename” for your file’s name and the “.csv” to .xml, .txt or even .html depending on what you’re trying to accomplish.

Share on Tumblr


Head of SEO and Inbound Marketing at UK's largest media planning and buying agency. Omar has over 10 years experience in digital marketing with the last 6 being in large media agency environments, developing and implementing cutting edge digital campaigns for some of the world's best known brands. For the latest in digital marketing and industry news and updates, follow Omar's Twitter stream (@OmarKattan) or add him to one of your Google+ Circles: . The content of this article represents the personal views of the author and does not constitute professional advice.

Share This Post

Recent Articles

© 2012 Omar Kattan. All rights reserved. Site Admin · Entries RSS · Comments RSS
Powered by WordPress · Designed by Theme Junkie
  • RSS
  • Twitter
  • Google Plus
  • Tumblr
  • Facebook
  • LinkedIn
  • FriendFeed
  • Digg
  • Flickr
  • YouTube
  • Delicious