Flash and SEO has been quite a problem and the main argument for the people in the business who is against Flash. I’ve planned to do something about this for a long time and finally I found a project that was suitable to try this. First I will say that many people think that making a website completely in Flash is craziness, and very often I do agree. However sometimes the client wants a “flashy” site with lots of animations and stuff and how am I to deny them that?
Since the introduction of SWFObject it’s been quite easy to provide the user with html content for those who does not have flash installed, and this is what I’ve done. Since I use amfphp a lot and also for my little CMS for flash, all the content except from the images are stored in a mySQL database. This makes it easy to extract all the content and echo it out in the flashcontent div tag.
I did this for a project called moelo.no and after a while Google index the whole site. To make it even more search friendly I used Apache Rewrite Engine to replace the query string URL with more search friendly URLs. I was surprised how easy easy it was to write the rewrite rule. Here is the all the lines I had to write to make it work:
RewriteRule ^kategori/([0-9]+)/underkategori/([0-9]+)/prosjekt/ ([0-9]+)(.*)\.html$ index.php?KategoriID=$1&UnderkategoriID=$2&ProsjektID=$3
RewriteRule ^kategori/([0-9]+)/underkategori/([0-9]+)(.*)\.html$ index.php?KategoriID=$1&UnderkategoriID=$2
RewriteRule ^kategori/([0-9]+)(.*)\.html$ index.php?KategoriID=$1
Now basically what this does is rewrite a url that looks like this:
http://www.moelo.no/index.php?KategoriID=1&UnderkategoriID=6
to this:
http://www.moelo.no/kategori/1/underkategori/6/
Then I add a suffix that takes the title of the article as filename and adds a .html extension to the end to to the URL to make it even more search friendly. The rewrite engine rules just ignores this. Now the URL looks like this:
http://www.moelo.no/kategori/1/underkategori/6/boliger.html
The next trick was to actually show the right content in the flash version as well when a user clicked a link in Google. I did this very easy by passing the arguments to SWFObject and this way I could load them as variables in flash:
var so = new SWFObject("http://www.moelo.no/index.swf", "index", "1000", "600", "8", "#ffffff");
so.addParam("quality", "best");
so.addVariable("kategoriid", "4");
so.addVariable("underkategoriid", "15");
so.addVariable("prosjektid", "122");
so.addVariable("forsiden", "");
so.write("wrapper");
Finally I added a rule in the robot.txt file that blocks the SWF-file from all robots.
It works like a charm!
The next job is to rewrite my hole flash based CMS into OOP because the hole shit is written in procedural code. This happened because it started as a minor project a long time ago and it has escalated for each project, and this makes it a pain in the ass to update and maintain.
Tags: amfphp, Flash, rewrite engine, SEO, XHTML

Hi Thomas
I’ve been ask to make one flash site SEO friendly. I’m PHP developer and ideally I would like to do it without touching the flash.
This site uses also amfphp. One thing which I don’t understand is how to or how did you populate html content for spiders. Basically:
– is there any method to populate information from amfphp straight to html (instead to flash) which would be grate by the way
or
- did you have to build additional site structures?
I guess the second answer would be correct but than I’m not sure how to synchronize both systems. In my case url is build like this: http://site/#/home or few other category names which would complicate everything even more.
Additionally:
Do you have one swf file which always starts from /index.html or did you have to generate separate swf for each section to make it synchronize with no flash content?
Hi Chris
Sorry for this aweful late reply, but here we go:
- There is no built in method to populate the content in html directly from amfphp. With that said, it’s only php anyway, and as in my case all the content is stored into mysql database and it took me one evening to write html output. It doesn’t really need a pretty design, just a simple menu and the more or less raw html output.
- Yes.
- I do the same query inside flash as I do in html based on the query string url by using rewrite. You can easeily do the same thing with SWFAddress and I belive that a .htaccess file with a working rewrite rule and a sample php file is shipped with the SWAdress.
- I only use one swf file.
I hope this answers your questions and I’m very sorry for the delayed answer. You have presumably finished your project by now.
Best regards
Thomas