after hours trying to fix the problem i think i got crazy :S
I have an ogg sound in my website which works fine on local (Apache by XAMPP) but it doesn't work at all on my VPS (Apache, CentOs and Kloxo) even if in my .htaccess i have all the mimetypes (audio/ogg ogg) and (application/ogg ogg).
This is the header i got in local(working):
Request URL:http://127.0.0.1/bass.ogg
Request Method:GET
Status Code:206 Partial Content
Request Headersview source
Accept:*/*
Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
Accept-Encoding:identity;q=1, *;q=0
Accept-Language:en-US,en;q=0.8
Connection:keep-alive
Cookie:PHPSESSID=08e4d19b19720f0a5491c20a7bba20c7
Host:127.0.0.1
Range:bytes=0-
Referer:http://127.0.0.1/
User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.160 Safari/537.22
Response Headersview source
Accept-Ranges:bytes
Cache-Control:max-age=2592000
Connection:Keep-Alive
Content-Length:59290
Content-Range:bytes 0-59289/59290
Content-Type:audio/ogg
Date:Fri, 15 Mar 2013 08:58:14 GMT
Expires:Sun, 14 Apr 2013 08:58:14 GMT
Keep-Alive:timeout=5, max=98
Last-Modified:Sat, 09 Mar 2013 14:23:45 GMT
Server:Apache/2.2.14 (Unix) DAV/2 mod_ssl/2.2.14 OpenSSL/0.9.8l PHP/5.3.1 mod_perl/2.0.4 Perl/v5.10.1
This is the header i got on my VPS(not working):
Request URL:http://www.mysite.com/jazz.ogg
Request Headersview source
Accept-Encoding:identity;q=1, *;q=0
Cache-Control:max-age=0
Range:bytes=0-
Referer:http://www.mysicians.com/
User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.160 Safari/537.22
I hope you can help so I can finally sleep well :) Thanks
I found a solution by myself and i hope it will help some people.
As you, all works fine on my local server Wamp. the problem was on my VPS with Apache. After adding this following lines in my .htaccess file (line 1 should be enough for ogg extension):
I still had trouble with Google chrome, i could play the sound in Firefox, Internet Explorer, Safari but not Chrome. I search hours and hours without finding the solution. It may be related to codecs but i'm not sure.
Finally, i worked around the bug by calling a distance source where the sound is played proprely.
Exemple in html5 with different sources to make sure the sounds plays in all browsers: