Sign up ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I have some PHP sites that embeds SWF files. These SWF files are now linked to by some other guys. And I don't want them to simply open the SWF, I want them to force being redirect to the page where the flash is embed.



So for >

**I now want to redirect the user who types into his URL to be redirect to

The Problem I have that the flash needs to be still accessible via <-- I don't get that working (the Flash is embed into that page).

The tool I would like to use for this is the .htaccess & RewriteRule. I hope someone can help me out.

share|improve this question

1 Answer 1

Well you can't make the users browser redirect while they are on the other site. You can however make it send a different file instead of the SWF they are hotlinking to.

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)? [NC]
RewriteRule \.(swf)$ [NC,R,L]

Just change with your domain and blocked.swf to whatever file you want them to see instead.

In the future you can code something in your flash files that looks for the host name and redirects them I'm sure.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.