views:

96

answers:

1

I have a file that can be reached using multiple paths:

http://mydomain.com/portal1/movie.swf
http://mydomain.com/portal2/movie.swf
http://mydomain.com/portal1/substep/movie.swf
etc.

I want a rewrite rule to get this specific file from the following path:

http://mydomain.com/movie.swf

How can I do that?

+1  A: 

in .htaccess in your main folder:

RewriteRule ^portal.*movie\.swf$ /movie.swf [L]

(backlash before the dot added after Gumbos comment. +1)

bjelli
I don't want to specify a rule for every possible path. Can I rewrite alle movie.swf's to /movie.swf using 1 rule?
Scharrels
Never mind - your solution worked. I used RewriteRule ^.*/movie.swf$ /movie.swf [L]
Scharrels
Don’t forget to escape the `.` character.
Gumbo