Hello,
First of all, the basics: running latest Ubuntu images with Serverpilot managing the server install.
I created a basic stats script (in the form of download.php?show=XX) for our radio station podcasts and everything works fine, except when trying to listen in iTunes. I checked, and here’s what Apple has to say about the matter:
The URL preceding GET-style form values (before the first “?”) must end in a media file extension (such as .mp3).
Correct
http://www.podcaster.com/load.mp3?f=&Wipeout.mp3
Incorrect
http://www.podcaster.com/load.php?f=&Wipeout.php
How would I change my server config so that I could run my PHP script under an mp3 extension?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
If this is a one-off exception just for load.php, you can use a rewrite: Add this to your .htaccess file:
RewriteEngine On
RewriteRule /load.mp3 /load.php
If you want all .mp3 files to be parsed as php, add the following line to .htaccess:
AddType application/x-httpd-php .mp3
You can configure Apache to use different extensions for php either through a configuration change or an .htaccess file. This page in the php manual should be what you are looking for:
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.