Changing Charatcteristics of a File – Static to Dynamic

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


New Age AdMan & proud father of 2 incredible kids. Omar heads-up SEO and Inbound Marketing at UK's largest media agency.

Omar has over 20 years experience in advertising the last 10 years being in digital marketing within 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: .

Share This Post

Recent Articles

Powered by WordPress · Designed by Theme Junkie
email
  • RSS
  • Twitter
  • Google Plus
  • Tumblr
  • Facebook
  • LinkedIn
  • FriendFeed
  • Digg
  • Flickr
  • YouTube
  • Delicious