Forum Moderators: phranque

Message Too Old, No Replies

301 redirect from swf file to html page

         

astounded123

11:33 am on Feb 3, 2009 (gmt 0)

10+ Year Member




I feature a flash game on my website and some time ago, google decided to index it, along with the page it features on. I gain nothing from people linking directly to the file, but am hesitant to disallow indexing of such files since it ranks quite well for a couple of terms.

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

Samizdata

2:05 pm on Feb 3, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I see no reason why a straightforward 301 shouldn't work.

There are plenty of examples in the forum, it is elementary stuff.

Don't forget to rename the actual .swf file.

Welcome to WebmasterWorld.

...

astounded123

3:18 pm on Feb 3, 2009 (gmt 0)

10+ Year Member



Thanks Samizdata. You're right, I followed an example here and it was very straightforward :).

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.

Samizdata

3:36 pm on Feb 3, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



If you are redirecting requests for "whatever.swf" to "whatever.html" and still want to use the .swf file you will presumably need to rename it or nobody will ever get to see it.

Because they will always be redirected, no?

...

astounded123

3:49 pm on Feb 3, 2009 (gmt 0)

10+ Year Member



I had assumed that too, but it doesn't appear to be the case.

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?

astounded123

3:50 pm on Feb 3, 2009 (gmt 0)

10+ Year Member



actually forget the above, the file was likely cached.

When I change the name for the .swf, is there any way in which I can stop it being indexed in future?

Samizdata

3:59 pm on Feb 3, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



OK slow down.

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

4:02 pm on Feb 3, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Put a <meta name="robots" content="nofollow"> tag on the html page that includes the swf file.

Jim

astounded123

4:13 pm on Feb 3, 2009 (gmt 0)

10+ Year Member



Samidzata - Thanks very much for the explanation. Do I need to delete the original swf file that I'm redirecting from (as i haven't done so as yet), or will google eventually ignore it due to the 301?

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.

jdMorgan

5:15 pm on Feb 3, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Nofollow does not affect the page that it is on, it tells the spider not to follow the links on the page.

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

Samizdata

5:27 pm on Feb 3, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



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.

...