Solved

htaccess RewriteRule interfers with Flash Media

Posted on 2011-03-17
3
999 Views
Last Modified: 2012-06-27
I have a simple htaccess Rewrite rule:

Options +FollowSymLinks
RewriteEngine On
RewriteRule ^Files/(.*)$ get.php?file=$1

Simple and works great, if it finds http://myco.com/Files/62/****.doc it redirects to file=/62/****.doc... PERFECT

my only problem is that when I embed a Flash player and actually look for the mov, mp4, flv... file inside of /Files/somedir/somemovie.mp4

the flash player gives me permission denied as the redirect hits to get.php, FAIL

I tried something like:

Options +FollowSymLinks
RewriteEngine On
RewriteRule \.(mov|mp4|flv)$ -
RewriteRule ^Files/(.*)$ get.php?file=$1

I just need to ignore one case... where file.php embeds FlowPlayer which calls Files/somedir/somemovie.mp4 any time this happens ignore the get.php RewriteRule
0
Comment
Question by:edjent
3 Comments
 
LVL 9

Accepted Solution

by:
fcontrepois earned 250 total points
ID: 35164031
Use RewriteCond


Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_URI} !.*\.(mov|mp4|flv)
RewriteRule ^Files/(.*)$ get.php?file=$1
0
 
LVL 50

Assisted Solution

by:Steve Bink
Steve Bink earned 250 total points
ID: 35170047
I'd prefer to modify your existing RewriteRule rather than use a RewriteCond, but that is just personal preference.  I have no idea if one method is more efficient than the other.

RewriteRule \.(mov|mp4|flv)$ - [L]

Open in new window

0
 
LVL 1

Author Comment

by:edjent
ID: 35183609
Thanks guys both solutions work great, so I split the points..

I didn't end up using either actually. after slipping these in realized there is a case where I need to fwd MP4's there as well, SO in light... I push the dir back on the .htaccess since Fetch doesn't exist and never will at that level in the path, it makes sense and also frees my Flash player for loading! Simple and sweet, not sure why I overcomplicated that one.

Options +FollowSymLinks
RewriteEngine On
RewriteRule ^Files/Fetch/(.*)$ get.php?file=$1
0

Featured Post

Easy, flexible multimedia distribution & control

Coming soon!  Ideal for large-scale A/V applications, ATEN's VM3200 Modular Matrix Switch is an all-in-one solution that simplifies video wall integration. Easily customize display layouts to see what you want, how you want it in 4k.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In Solr 4.0 it is possible to atomically (or partially) update individual fields in a document. This article will show the operations possible for atomic updating as well as setting up your Solr instance to be able to perform the actions. One major …
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question