Forum Moderators: phranque
Therefore I'd like to create a 301 redirect from the specific flash file to a specific html page. How would I go about doing this?
Thanks
Out of curiosity though, why do I need to rename the .swf file? Is it so that it is removed from the search index? Will all of the ranking power then be transfered to the page on which the flash file is embedded? Both the page and the file currently feature in google.
I added an .htaccess file with something along these lines "redirect 301 /games/GAMENAME.swf [SITENAME...]
and it now correctly redirects when I click on the .swf search engine result, as I intended. However, when I go directly to the [SITENAME...] page, the game loads as usual. Maybe the redirect only applies to outside sites?
The file is in a different directory now, so you have effectively renamed it already.
The 301 will (after a little time) lead to the Flash file being dropped from the index. The HTML file should (hopefully) get the benefit of its ranking. The new (moved) Flash file will start from scratch.
Google will honour a disallow in robots.txt for .swf files (or any other extensions of your choice), or you can put the file in a dedicated directory and disallow that.
Everything depends on what you are trying to achieve.
...
jdMorgan - I'm hesitant to do so as the page ranks well in google and as I update it on occasion. I'll place a disallow file instead.
Disallow in robots.txt will prevent spiders from *fetching* the .swf. It will not prevent them from showing a URL-only link to the .swf in search results. Further, some spiders will build a title for the search results listing by using any anchor text ("link text") they find on the Web. So a robots.txt Disallow does not solve your problem. (This URL-only search listing behaviour for Disallowed URLs is relatively-new, resulting from a 'competition' between search engines a few years back to "discover the 'deep Web'" -- Personally, I find it annoying. To avoid it, you must *not* Disallow the URL, but instead mark pages as "noindex", or specify that the links on pages are "nofollow" using the on-page robots meta-tag.)
An alternative is to cloak the link, but this requires "bullet-proof cloaking" using both user-agents and a well-maintained list of search engine spider IP addresses.
Jim
Do I need to delete the original swf file that I'm redirecting from
I believe that is advisable - and as you are redirecting, why keep it?
As for the disallow, I always read what Jim says very carefully.
But I use this in my robots file:
Disallow: /*.swf$
and as far as I am aware no search engines ever crawl or index my Flash files.
My understanding is that this method may only be supported by the major engines.
But they are the only ones allowed on my sites.
...