# Bad url in js script

**URL:** <https://www.ruby-forum.com/t/bad-url-in-js-script/184991>\
**Category:** Rails\
**Created:** [March 11, 2010, 3:47pm UTC](https://www.ruby-forum.com/t/bad-url-in-js-script/184991 "2010-03-11T15:47:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kadoudal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/f0a364/32.png) [@kadoudal](https://www.ruby-forum.com/u/kadoudal)\
**Post date:** [March 11, 2010, 3:47pm UTC](https://www.ruby-forum.com/t/bad-url-in-js-script/184991/1 "2010-03-11T15:47:28Z")

</div>

When running in development env, I don’t have this problem, only in  
production…

I have a view in which a js script display a FlowPlayer video player  
(+ plugins)…  
the flash files are located in the /public/dist folder, ant the  
script calls them like that :

 $f("player", "/dist/flowplayer-3.1.5.swf", { plugins: { rtmp: { url: "/dist/flowplayer.rtmp-3.1.3.swf" } openAdStreamer: { url: '/dist/OpenAdStreamer.swf', .. how should I write the url to work both in dev and prod modes ? thanks for your help erwin

---

<div class="post-metadata">

**Author:** ![kadoudal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/f0a364/32.png) [@kadoudal](https://www.ruby-forum.com/u/kadoudal)\
**Post date:** [March 11, 2010, 5:05pm UTC](https://www.ruby-forum.com/t/bad-url-in-js-script/184991/2 "2010-03-11T17:05:20Z")

</div>

I believe the problem is linked to using a sub-uri in production  
the /dist folder is search at the application root not at the relative  
url

need more inquiries
