All pastes #333386 Raw Edit

Something

public text v1 · immutable
#333386 ·published 2007-01-30 21:46 UTC
rendered paste body
Hiya,

Okay, I'm having a few problems all of a sudden with some scripts in .htaccess. Let me explain myself:

I have a directory full of *.swf files. When people click a link to a particular .swf file, I want it to redirect to a .swf file located in a different directory (it will have the same filename).

Just to avoid some questions, I have mod_rewrite enabled on my server, and I know that .htaccess is working fine because I have other mod_rewrite scripts working perfectly in the same .htaccess file (and others). Also, I do not want to use the Redirect rule, just the Rewrite rule.

The code I have done is:


CODE
RewriteEngine On

Rewriterule ^games/rgames/swf/(.*).swf http://www.ipengo.com/forums2/$1.swf


The .htaccess file that this code is located in is in the root of http://www.ipengo.com , so games/rgames/swf/ is the correct Rewrite extension to use, as far as I'm aware. (ipengo.com/games/rgames/swf/ exists)

So, according to the rule I have set:

Clicking on http://www.ipengo.com/games/rgames/swf/60seconds.swf should redirect to http://www.ipengo.com/forums2/60seconds.swf (both of these links work, which you are welcome to test - but if you let the game load then the background music can be very annoying).

Baffled by the fact that it doesn't work (as you will probably see if you click the link above), I tried simplifying the expression to:


CODE
RewriteEngine On

Rewriterule ^games/rgames/swf/60seconds.swf http://www.ipengo.com/forums2/60seconds.swf


Just to test if it works with this particular .swf. Again, no luck (I have since changed back to the original script).

I have also attempted to place a .htaccess in the /swf/ folder, and simply apply the same Rewriterule but without the games/rgames/swf/ prefix

I guess what I would like help with is how or where I may have made an error, and how to rectify the problem?