Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Web Design (WordPress, Joomla, etc.) htaccess and mime types

  • htaccess and mime types

    Posted by Jeff Mack on August 19, 2010 at 3:10 pm

    I have a page on godaddy and I have a lot of videos installed in flash. Now I am trying to make an IPhone compatable page and have added m4v’s and mp4’s but they won’t play on an iPhone 3G. I was told I need to add mime types and that you do that by adding them to the .htaccess file. My site never had one. I did a little research and created one from a generator. Then I saw the lines to add the mime types so I combined them. I cut and pasted the following into a TextEdit file on my mac. Then uploaded it to my root directory and nothing happened. Can anyone tell me if this is right or how to fix it?

    deny from all

    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^(https://www\.texasmusicchannel\.net)(:80)? [NC]
    RewriteRule ^(.*) https://texasmusicchannel.net/$1 [R=301,L]
    AddType audio/x-m4a MPEG-4 media m4a
    AddType video/mp4 MPEG-4 media mp4
    AddType video/x-m4v MPEG-4 media m4v
    order deny,allow

    Jeff

    Jeff Mack replied 15 years, 8 months ago 2 Members · 18 Replies
  • 18 Replies
  • Curtis Thompson

    August 19, 2010 at 3:15 pm

    hello…

    first step is – this will only work if you are running a *nix hosting plan running apache as the webserver as opposed to a windows hosting plan…

    do you know if you are running apache?

    sitruc

  • Jeff Mack

    August 19, 2010 at 3:25 pm

    Yes.

    Server IP Address: 97.74.215.192 SSL Status: Purchase SSL Certificate Operating System: Linux Hosting Type: Shared Hosting Hosting Configuration: 2.1 PHP Version: PHP 5.x MySQL Databases: 0 Setup of 25 Available Bandwidth Allotment: 1,500,000 MB Disk Space Allotment: 150,000 MB Data Center: US Regional Data Center
    Search Engine Visibility: Analyze my site Primary Domain DNS: View

    jeff

  • Curtis Thompson

    August 19, 2010 at 3:52 pm

    hello…

    ok – next thing is to find out if the settings for apache at godaddy allow you to override those types of things – htaccess can be configured on a server level to allow a lot or a little, and most large isps tend towards the latter to avoid having users make a mess.

    (not that you are, but you get what i’m saying)

    so check to see if godaddy allows you to override those settings. can you also point us to the site where you read this as a recommendation?

    sitruc

  • Jeff Mack

    August 19, 2010 at 4:25 pm

    Just called them and they do allow mime types to be added to my site through the .htacces file. I am looking to add h.264 .mov’s, mp4’s and m4v’s so I can view them with an iPhone. I have 3 identcal files on my site here:

    https://www.texasmusicchannel.net/1.mov /1.mp4 and /1.m4v

    I have the same files on my mobile me account here:

    web.me.com/yasgur/1.mp4 and /1.m4v.

    The files play on my mm account but not on my godaddy account. The funny thing is that on my desktop machine, the .mov plays on my godaddy account but the others give me a file not found.

    Jeff

  • Curtis Thompson

    August 19, 2010 at 5:53 pm

    hello…

    from what i’m seeing, your rewrite rules aren’t doing anything at all – these 2 lines:

    RewriteCond %{HTTP_HOST} ^(https://www\.texasmusicchannel\.net)(:80)? [NC]
    RewriteRule ^(.*) https://texasmusicchannel.net/$1 [R=301,L]

    would in theory redirect any request to “https://www.texasmusicchannel.net” to the non-www “texasmusicchannel.net”…however HTTP_HOST does not include the http protocol in it, so this rewrite condition should never match. it also wouldn’t help with your mime types at all, because it’s just a url shuffle…

    however, i notice when i go to either:

    https://www.texasmusicchannel.net
    https://texasmusicchannel.net

    i automatically get redirected to:

    https://texasmusicchannel.net/TMC/home.html

    and there is definitely nothing in those rewrite conditions to do that, so i don’t know what all you have going on there, but it would appear that what you are using on the server is not what you pasted here?

    also – since i can’t see your files, i have to ask the dumb question – are you sure you have the 1.mp4 and 1.m4v files on your godaddy account?

    sitruc

  • Jeff Mack

    August 19, 2010 at 8:33 pm

    Hey Curtis,

    I gues you need to disregard that htaccess file. I used an htaccess generator I found on the web and then I added the mime types to it. I totally DON’T know what I am doing with that. My godaddy account has 7 web pages hosted there. My main pafe is the texasmusicchannel site. the index page is in my root directory and the pages are directed into the TMC folder.

    Here is what my root looks like:

    So, the bottom line, the mp4 and the m4v won’t play. The .mov plays on my desktop but not on the phone. I just don’t know what to do and GODADDY won’t help me.

    Jeff

  • Curtis Thompson

    August 19, 2010 at 8:41 pm

    hello…

    ok – so do you know how you have the redirect setup to the TMC sub dir? is that in an htaccess file or in code somewhere as a meta or the likes?

    that could be part of your problem, but w/o being able to see everything, it’s hard to debug…

    wrt the movies – to go back to the start, do you want to:

    a) automatically redirect any request to 1.mov to 1.m4v if the user is visiting on an iphone or an ipad?

    b) redirect any request from an ipad or iphone to a sub dir that has these videos?

    best way to temporarily disable the htaccess there now is to just rename it to “.htaccess_OFF” or the likes and then it won’t kick in and you can see where the TMC redirect is happening…

    (and i’ve heard that godaddy doesn’t honor these changes for a few minutes, which honestly makes no sense, but at a minimum you’ll need to clear your cache when reloading the site)

    sitruc

  • Jeff Mack

    August 19, 2010 at 8:59 pm

    the redirect is in code in my index file. I will delete the htaccess as it was something I made with my head up my ass.

    As far as the movies, the only reason they are in the root is because it was easy to test them there. I will delete those when this gets working.

    My first thought was to create this page: https://texasmusicchannel.net/TMC/the_os_City_1-29-10_Iphone.html

    These are h.264’s that are hyperlinked to the files. They play on the 3GS and a 4G but not on a 3G. This is what started my whole problem. So I started to think an mp4 or an m4v would work better.

    So I actually created a page (which is now gone) that had a gallery of mp4’s and m4v’s but they wouldn’t work at all.

    GoDaddy totally will not help me and on another forum, someone suggested I add mim types. The only way to do that is to add an htaccess file.

    So now I am thoroughly confused.

    Jeff

  • Curtis Thompson

    August 19, 2010 at 9:07 pm

    hello…

    don’t delete stuff yet – i realize we’re still testing…

    so i guess i’m still not clear on what you want (regardless of what you’ve tried to this point)…let’s say for the sake of discussion that 1.mov is right where you want it, and you have 1.m4v and 1.mp4 there as well.

    if you embed the movie in a page, you won’t be able to show one version for iphone/ipad and another for others just by doing htaccess stuff. if, on the other hand, you are giving the link directly to somebody (i.e. https://foo.com/1.mov), then you can redirect browsers that go to that url based on the http host and get them to the right file for their platform…

    so it sounds like you’d rather go for option (b) from my original choices, which is to have an iphone user get redirected to a special portion of your site if they go to a like non-iphone portion. so for example, let’s say you have:

    https://foo.com/videos/index.html

    and you want to have iphone visitors see a special iphone version automatically. you can use rewrite rules to automatically have them go to:

    https://foo.com/videos/index_iphones.html

    is that a desired goal here? if so, i can set up an example for you on another server that you could look at, or you can google up the answer to that one…

    if not, let me know what you want to do ultimately (not really what you’ve tried) so that i can best help you figure out how to achieve that goal…

    sitruc

  • Jeff Mack

    August 19, 2010 at 9:45 pm

    I think this will give you the idea of what I am trying to do.

    https://web.me.com/yasgur/Dallas_FCPUG/Dallas_FCPUG_Blog/Dallas_FCPUG_Blog.html

    This is a page hosted on my mobile me account. As you see on the home page, there is an iPhone for users to click to see the videos on their phone. The home page utilizes a flash playlist for desktop services. Now, how can I send this page to GoDaddy and play those files on my godaddy account?

    Jeff

Page 1 of 2

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy