?
Solved

htaccess RewriteRule interfers with Flash Media

Posted on 2011-03-17
3
Medium Priority
?
1,002 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 9

Accepted Solution

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


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

Assisted Solution

by:Steve Bink
Steve Bink earned 1000 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

Optimum High-Definition Video Viewing and Control

The ATEN VM0404HA 4x4 4K HDMI Matrix Switch supports 4K resolutions of UHD (3840 x 2160) and DCI (4096 x 2160) with refresh rates of 30 Hz (4:4:4) and 60 Hz (4:2:0). It is ideal for applications where the routing of 4K digital signals is required.

Question has a verified solution.

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

In my time as an SEO for the last 2 years and in the questions I have assisted with on here I have always seen the need to redirect from non-www urls to their www versions. For instance redirecting http://domain.com (http://domain.com) to http…
If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

771 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