Issue with playing some .mp4 on Google Chrome - .htaccess

I have downloaded some .mp4 files from shutterstock to use them in my website project.
Everything works perfect on localhost, i can play the movies like localhost/example.mp4 on every browser. I uploaded the files on my server, but now, it won`t play with Google Chrome (myserver.com/example.mp4), but will play with other browsers. This is very strange.
Anyone have any explanation ?
I checked the mime types in my cPanel account and all are ok, also i added the next code into htaccess but still doesn`t work.
AddType video/ogg .ogv
AddType video/mp4 .mp4
AddType video/mp4 .mov
AddType video/webm .webm
and
<FilesMatch mp4>
Satisfy any
order allow,deny
allow from all
</FilesMatch>
What should be the issue? Is a file issue or an issue from the server? Cues from localhost it will open in Google Chrome.

Related

Icomoon fonts wont show on server

Im trying to get icomoon fonts working. locally they work fine but on the server (sitefinity) they don't work.
I have tried using .htaccess with the following but it does not work.
AddType application/vnd.ms-fontobject .eot
AddType application/x-font-opentype .otf
AddType image/svg+xml .svg
AddType application/x-font-ttf .ttf
AddType application/font-woff .woff
AddType application/font-woff2 .woff2
<IfModule mod_headers.c>
<FilesMatch ".(eot|otf|svg|ttf|woff2?)$">
Header set Access-Control-Allow-Origin "*"
</FilesMatch>
</IfModule>
This is the error i see:
No 'Access-Control-Allow-Origin' header is present on the requested resource.
I'm confused - is that .htaccess on the Sitefinity server that's hosting those fonts, or is it on your server (of your webpage that's trying to access the fonts from Sitefinity)?
If you're trying to access fonts on another site, it has to be that site that returns the ACAO response header (with the font itself).
If you can provide an example request for a font file, that might help, but TBH, CORS was pretty much designed so that people couldn't just include fonts from a 3rd-party (a 'font factory') on their own site. So I suspect that in this case, your webpage is trying to get the fonts from Sitefinity, the browser is passing the Origin request header with the GET request for the font, and Sitefinity is refusing to return the ACAO response header, so your webpage won't display the fonts.

SVG files not working after switching website hosting to my NAS

I'm now hosting my website off my personal NAS drive and everything seems to be working except the SVGs.
I tried adding the .htaccess file with:
AddType image/svg+xml svg svgz
AddEncoding gzip svgz
but they still do not work. When I go to the URL of the file it just shows an error as if the file does not exist.
Any ideas?
Thanks in advance!

WOFF2 - HTTP Content-Type response header suggestion

I'm doing some website optimisations using PageSpeed. I faced a next suggestion:
The following resources have no character set specified in their HTTP
headers. Specifying a character set in HTTP headers can speed up
browser rendering.
http://localhost:8892/.../FocoBold.woff2
http://localhost:8892/.../FocoRegular.woff2
http://localhost:8892/.../GTblack.woff2
I've instantly started google and found a relevant answer on StackOverFlow.
I've added next line to .htaccess but it didn't worked for me.
AddDefaultCharset UTF-8
Next thing I've tried, but still no results.
AddType font/woff2 .woff2
Can anyone help me with that?
Thank you in advance
I was having the same problem.
I think that pagespeed is misreporting the underlying cause which is not so much a lack of definition of the charset, but a lack of definition of the content-type. Without that's being defined, it / most browsers assume what is being sent back is text/html, where, indeed, no charset has been defined, especially as the .woff2 file will contain "non-standard" (ASCII!) chars.
My solution (it may not work if your apache environment is significantly different, such as not allowing addtype in .htaccess files) was to add the following to the .htaccess in the relevant root of the site being served:
AddType application/x-font-woff2 .woff2
(Found this resource)
Worked for me!
.htaccess
In .htaccess AddType should be in mod_mime.c module
<IfModule mod_mime.c>
AddType application/woff2 .woff2
</IfModule>

Excel xlsx files downloading as zip file

The following is happening in IE8. The server is Apache2 on Ubuntu.
I'm trying to get an excel file to download via a link. When I click the link the file shows with a .zip extension.
I've set the mime-types in a .htaccess file and also can see they are in the /etc/mime.type file.
The .htaccess file as follows:
AddType application/vnd.ms-word.document.macroEnabled.12 .docm
AddType application/vnd.openxmlformats-officedocument.wordprocessingml.document docx
AddType application/vnd.openxmlformats-officedocument.wordprocessingml.template dotx
AddType application/vnd.ms-powerpoint.template.macroEnabled.12 potm
AddType application/vnd.openxmlformats-officedocument.presentationml.template potx
AddType application/vnd.ms-powerpoint.addin.macroEnabled.12 ppam
AddType application/vnd.ms-powerpoint.slideshow.macroEnabled.12 ppsm
AddType application/vnd.openxmlformats-officedocument.presentationml.slideshow ppsx
AddType application/vnd.ms-powerpoint.presentation.macroEnabled.12 pptm
AddType application/vnd.openxmlformats-officedocument.presentationml.presentation pptx
AddType application/vnd.ms-excel.addin.macroEnabled.12 xlam
AddType application/vnd.ms-excel.sheet.binary.macroEnabled.12 xlsb
AddType application/vnd.ms-excel.sheet.macroEnabled.12 xlsm
AddType application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx
AddType application/vnd.ms-excel.template.macroEnabled.12 xltm
AddType application/vnd.openxmlformats-officedocument.spreadsheetml.template xltx
I've looked a loads of forums some say the leading dot for .docm on the the first line should be added other say not. The Apache documentation say it can include on not include the leading dot. I've tried with both.
I've copied the code to a text editor to make sure there are no hidden characters and pasted it back.
I've cleared the browser cache after each change and restarted Apache. Nothing seems to work.
This did work on our old server so I'm convinced the problem is server configuration.
Any help would be appreciated.

Drupal MP4 videos not playing in Firefox

I've added these 2 lines to our htaccess file, but the video shows a dark screen with No video with supported MIME type and format found:
AddType sites/default/files/videos/original/webm .webm
AddType sites/default/files/videos/original/mp4 .mp4
sites/default/files/videos/original/webm and sites/default/files/videos/original/mp4 aren't mime-types. You're probably looking for video/webm and video/mp4, respectively.

Resources