Problem with mod_rewrite and play video on page with flash

Hi
First of all, I apologize for weak English language .

I make a web page on my local computer and in that page i show a FLV video file with MPW_PLAYER ( this player using flash )
Problem in my URL when i use URL like below :

http://127.0.0.1/showfile.php?hash=<FILE_HASH>

every things work FINE and there is no problem.
After i use Mod_rewrite on Apache my URL change to :

http://127.0.0.1/s/<FILE_HASH>

all part of the page load FINE but player does’n work!!

I test JW player too and again it does’nt work.

[URL=“http://mpw-player.soft112.com/”]MPW player site

[URL=“http://jwplayer.com/”]JW player site

Thanks .

It may have something to do with relative vs absolute paths to the video player or it’s source. Please check both to make sure that the path to the video player and the source are both correct after the rewrite.

I found the solution in this post on stackoverflow.com

I know its old question, but just in case someone will still search for an answer. I just witness same errors.

The deal is: with L parameter mod_rewrite will point request to the location you specified but all the ajax calls, includes, javascript src requests will behave as you where under original location.

Check the headers using LiveHeaders in Firefox for instance and you will see that your requests are pointing to wrong locations. I.e.: if in your play.php you link javascript like

src=“myJS.js”
if RewriteRule points from

[siteroot]/play/some_data_here
to

[siteroot]/play.php?data=some_data_here
you will see that your play.php file will try to include src=“play/myJS.js” which of course is not there so it returns 404 aka text/html.

In my case I ‘fixed it’ by adding R parameter so it redirects to new location. Down side of this is that address in the browser will change. Try changing [QSA,L] to [QSA,L,R].

Hope this helps.

Post Address

when we use mod_rewrite all js file and all other part of our player src should write with full pass

for example if we use this URL

http://127.0.0.1/s/<FILE_HASH>/

and this script in header :

<script src="swfobject.js" type="text/javascript"></script>

after run script src ( i found it with Live Header in FireFox ) will be :

http://127.0.0.1/s/<FILE_HASH>/swfobject.js

then return 404. Src should wirte in full path :

http://127.0.0.1/script_path/swfobject.js