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?

Accepted Answer

in .htaccess in your main folder:

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

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

Written by bjelli
This page was build to provide you fast access to the question and the direct accepted answer.
The content is written by members of the stackoverflow.com community.
It is licensed under cc-wiki