Re: [jPlayer] jPlayer not working with .htaccess RewriteRule in some browsers

129 views
Skip to first unread message

Sean Miller

unread,
Sep 12, 2012, 2:22:12 AM9/12/12
to jpl...@googlegroups.com
On 11 September 2012 22:51, -Jc. <john...@wlsys.co.uk> wrote:
I rewrite it to
Problem is, jPlayer in the first example works fine on every browser, but after the rewrite... it's ok in Chrome, IE9 and iOS, bt nothing in FF, Safari or IE7/8 - a pretty big chunk of the audience.

It could be to do with relative path names... as far as the browser is concerned show.php?artist=rhcp is in the / directory, artist/rhcp is two levels down.

Make sure all pathnames are absolute in any code. 

Sean

-Jc.

unread,
Sep 12, 2012, 4:55:19 AM9/12/12
to jpl...@googlegroups.com
Hi Sean,
 
Thanks. I thought the same at first. All paths in my code are absolute -two .js files and the media:
 
<script type="text/javascript" src="http://lmmuk.com/js/jquery.min.js"></script>
<script type="text/javascript" src="http://lmmuk.com/js/jquery.jplayer.min.js"></script>
<li><a href="http://www.lmmuk.com/upload/files/The_ATeam_Billie_Jean.mp3" class="track track-default">
 
is there anything inside the jPlayer code that relies on absolute/relative paths?
 
Thanks! -Jc.

-Jc.

unread,
Sep 12, 2012, 5:58:59 AM9/12/12
to jpl...@googlegroups.com
Still haven't solved the original issue, but I've got a workaround -using an iframe to display the player, served from the main / directory. 
 
 
I hope this helps someone. I'll leave these demo links live as long as I can.
 
Cheers! -Jc.

Sean Miller

unread,
Sep 12, 2012, 6:15:54 AM9/12/12
to jpl...@googlegroups.com
swfPath: "js" 

That's relative, surely?

Sean

-Jc.

unread,
Sep 12, 2012, 6:24:21 AM9/12/12
to jpl...@googlegroups.com
Sean, you're a superstar!I didn't even see that in the code. Amazing how blind you can be to the bleedin' obvious.
 
Three days of my life for one forward slash. (It's usually a semicolon.)
 
Thanks a million!
 
-Jc.

Sean Miller

unread,
Sep 12, 2012, 7:00:42 AM9/12/12
to jpl...@googlegroups.com
On 12 September 2012 11:24, -Jc. <john...@wlsys.co.uk> wrote:
Sean, you're a superstar!I didn't even see that in the code. Amazing how blind you can be to the bleedin' obvious.

Glad to be of help :-)

Sean

Jesse Smith

unread,
Sep 12, 2012, 11:30:15 AM9/12/12
to jpl...@googlegroups.com
I use this line to redirect my urls.

# tracks
RewriteRule ^([^/]+)/tracks/([^/]+).mp3 /wp-content/tracks.php?blogname=$1&mp3=$2 [L]

This will send the variables blogname and mp3 within the url to a file named /wp-content/tracks.php
sample url will look like this

I then use the tracks.php to locate the mp3 and find if it exists and if so I read the file with readfile($mp3).

If you need more info let me know.


From: -Jc. <john...@wlsys.co.uk>
To: jpl...@googlegroups.com
Sent: Tuesday, September 11, 2012 2:51 PM
Subject: [jPlayer] jPlayer not working with .htaccess RewriteRule in some browsers

Hi,
 
I'm having trouble with jPlayer and .htaccess URL rewriting. I need to hide the full url for SEO and neatness, so instead of
 
I rewrite it to
Problem is, jPlayer in the first example works fine on every browser, but after the rewrite... it's ok in Chrome, IE9 and iOS, bt nothing in FF, Safari or IE7/8 - a pretty big chunk of the audience.
 
Here's a simplified example, based on the text based demo (http://jplayer.org/latest/demo-04/)
 
without rewriting... works! http://www.lmmuk.com/au_play.html 
 
after rewrite... broken! http://www.lmmuk.com/sounds/
 
this is the rule I'm using in .htaccess:
RewriteRule ^sounds/ au_play.html
 
same page source, different outcome. Help!
 
Anyone got any ideas?
 
Thanks!
 
-Jc.
--
You received this message because you are subscribed to the Google Groups "jPlayer: HTML5 Audio & Video for jQuery" group.
To view this discussion on the web visit https://groups.google.com/d/msg/jplayer/-/iwXRd4Y8GKgJ.
To post to this group, send email to jpl...@googlegroups.com.
To unsubscribe from this group, send email to jplayer+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/jplayer?hl=en.


Reply all
Reply to author
Forward
0 new messages