SWFAddress SEO solution for Gaia Flash Framework

March 26, 2009 by: Christian

I’ve been using the SEO solution of SWFAddress for more then 2 years and I’m completely happy with it.

You can find the demo here. It uses Javascript and mod_rewrite to provide clean urls. In Gaia, you can SEO-scaffold your project. It will create html pages for each flash page, which in fact is very nice if you have a small website with no more than 10 to 15 pages. There is nothing to say about that. But if you have a large project, a website that dynamically generates content, it would not be wise to create thousands of physical html pages on your server. So here we need another solution. Check out this flash site, it has over 16′000 pages in the Google index… ;-)

The other drawback is that it does not generate “nice” urls. It looks something like this http://www.mydomain.com/news.html#/about-us/
when I actually want this:
http://www.mydomain.com/#/about-us/
Read more in the gaia forum

The original SWFAddress SEO solution:
SWFAddress SEO Sample Flash vs no Javascript

…and here is what it looks like when implemented in Gaia:
Gaia Flash versus no Javascript

Use the context menu (right-click) to navigate. Now deactivate Javascript, navigate, activate it again, navigate… and always watch the browser address bar.
Another nice thing about this implementation is that the navigation menu is dynamically created by parsing the site.xml. This is done using SimpleXML, so be sure you have PHP 5 installed!

Overview

Gaia SWFAddress alternative SEO solution

Download all the source files here.

Before you upload the files to your server, open the file .htaccess and change this line…
RewriteBase  /wp-content/data/gaia_swfaddress_seo_demo
…to the folder where your uploaded files will be.

Please note that for this SEO solution the Gaia site attribute “landing” is required! This attribute is used to determine if a menu item is active (clickable) or not. Check seonavig.php for more info.
The content of the site is defined in datasource.php. This file is accessed by index.php and dynamicContainer.swf.

Questions? Suggestions? Let me know!

Happy coding!
Christian

UPDATE 08/18/2009: Be sure to check out the open source Fleb Framework. It is a complete Flash + SEO solution without compromises and has improved express install.

.

Comments

30 Responses to “SWFAddress SEO solution for Gaia Flash Framework”
  1. Lois Gab says:

    Hi Christian

    Do you think that Gaia FRAMEWORK is a better solution then SEO SWFaddress ?
    The Framework works on APACHE PHP 4.x ?

    I have completed a site with SWFaddress and I seek a solution
    to reference all my pages without the “#” anchor… GAIA or simply SEO ?

    With GAIA, I would insert my SWF’s file in the index.php and that’s it
    or there is a lot of set up?

    Thanks !
    Best regards
    Lois

  2. Lois Gab says:

    So !
    I was so happy to read something on it
    that i don’t really taken time to read exactly your comment.
    I got the idea ! SEO is better for the big site and the URL’S without “#”.

    thank you so much for your infos Christian.

    Best
    Lois

  3. admin says:

    Hi Lois
    Gaia is one thing, SWFAddress another. Here these two are just combined in a different way then Gaia does it with it’s seo scaffolding. As I said, the Gaia SEO way is perfect for small sites, but when it comes to larger full flash projects, you will need a more dynamic solution, which I described here! ;-)

  4. Lois Gab says:

    Hi

    Thank you so much for your answers.
    There is a CMS side with Gaia site ?

    Best
    Lois

  5. admin says:

    @Lois Gab
    The Turtlebite Flash CMS is a back end full Flash CMS which can be used in Gaia (I do this myself already), but also with any other flash website.

  6. Lois Gab says:

    Hi Christian !

    Thanks you very much for your answers !!!
    I didn’t knew that there was a CMS for FLASH.
    It’s easy to implement for any flash site or only on GAIA site?

    Best
    Lois

  7. Pieter says:

    Hi Christian,

    Thank you for this! I like your solution a lot. I tried your files on my server end they work very well.

    But to really play around with it, I want to test things locally first. Somehow I can’t get it to work on a local server (I am using MAMP).

    This is what I did so far:

    1) I changed the RewriteBase line in .htaccess to: RewriteBase /
    2) I checked if “AllowOverride” was set to “All” in the apache config file. (It is by default).
    3) I changed the “document root” of Apache to the folder where I’ve copied your files.

    Then, when I test, the browser keeps saying “contacting localhost” for a while and shows a blank screen.

    Do you have any idea what I am doing wrong?

    Thanks in advance!
    Pieter

  8. admin says:

    @Pieter
    I don’t know MAMP, I’m using XAMP (http://www.apachefriends.org), before on the PC, now on the Mac (Yeah, I switched back ;-) . I have to try MAMP, it looks cool! So I can only say that I downloaded the files, put the bin folder in the XAMP folder and changed the RewriteBase to “/~christiankaegi/bin”. That’s it, works perfectly.

  9. Pieter says:

    Thanks you Christian. I installed Xampp (two P’s. There also seems to be one around with one P). Now everything works as expected.
    Pieter

  10. Pieter says:

    Hi Christian,

    I managed to incorporate your SEO solution into my personal site.
    Now I have also been trying to have Gaia generate a sitemap.xml. This doesn’t work because I skipped the seo=”true” attribute from site.xml. So I was wondering, wouldn’t it be a good idea to have a sitemap.php script creating a sitemap out of datasource.php or site.xml? I dont’ know much about PHP, but I would think it’s not that big a deal.
    It’s just a thought. Maybe it doesn’t make any sense.

    Pieter

  11. admin says:

    @Pieter
    It makes a lot of sense :-) In fact, this is already on my todo list… But for now the release of my CMS has highest priority.

  12. Pieter says:

    The sitemap.php is not really that urgent. Just found this tool: http://www.xml-sitemaps.com. Works perfectly!

  13. liflaf says:

    Hi Christian.

    First of all, congratulations with the release of your CMS. I’m going to check it out once I’ve got time.

    I’ve got two questions about your SEO solution.

    On a site I’m trying to build, my site nodes look like this:

    My first question is, can I leave the “route” attribute out, when its value is the same as that of “Title”? (I guess not since seonavig.php is looking for the “route” attribute).

    Secondly and more importantly: it seems to be a problem that the “route” value is equal to the “src” value without the .swf extension. When I disable javascript in my browser and go to http://www.mysite/tosca, all I get is the tosca.swf file in the browser (which obviously isn’t functioning without main.swf and index.swf). The browser thinks that I want to browse to the flash file, even when I am not typing the .swf extension in the address bar. When I rename tosca.swf for the time being, it works as expected: I get a html page with the appropriate text from datasource.php.

    Naturally, I could rename all .swf files, or change the route value to “/whatever/tosca”. But it would be nice if there was a more elegant solution. Should I add a rewrite rule in htaccess? Or make some changes is seonavig.php? What do you think?

    Thanks again!
    Pieter

  14. admin says:

    Hi Pieter

    Yes, you have to leave the “route” even if “title” is the same.
    Secondly: I experienced the same issue when I switched to the Mac: Obviously, the system recognises that when you have a link like “http://www.mysite/tosca”, where you want it to merely show your seo content, that there is a SWF by that name “tosca.swf”, and instead shows that. My solution to this is I started to save all my SWFs with a leading “_”, so the SWF is “_tosca.swf” and there is no “tosca.swf” anymore to load.

  15. liflaf says:

    Okay, thank you Christian. I’ve put an underscore before all my SWF’s. Now it works as expected.
    One more question though. If for example I put an Umlaut somewhere in the datasource text in your example, or some other accent, I get an error message: “#1052: Invalid URI passed to decodeURIComponent function”. I know I could use a Unicode converter to use substitutes like ü or %C3%BC. But do I really have to do that?

  16. admin says:

    Hi Pieter
    I don’t have a problem with german umlaute or other special characters. Are you sure you use “rawurlencode()” when you echo the vars in php?

  17. admin says:

    Sorry for the late response… but the solution is simple! :-)
    I did exactly the same thing as you, and it worked. I opened datasource.php with TextMate, than it was no problem. Then I did the same thing with Textedit, and it broke. That was when I realized that it has to do with text encoding: You have to save it in UTF8 format. TextMate does this already, in TextEdit the default on my Mac was “Mac OS Latin”. I’ve had this problem very often when I was working on the PC. Solved? Let me know!

  18. liflaf says:

    Solved! That did the trick! I saved a copy as “UTF-8 no BOM” in TextWrangler e voilà!
    Previously I did the editing in DreamWeaver which has “Unicode 5.0 UTF-8″ set as its standard encoding, so I was wondering why this didn’t work. Turns out that when I start a blank PHP document in DW and copy all your code into it, I can add as many umlauts as I like!
    Thank you very much for all your help, Christian!

  19. admin says:

    Cool! :-)

  20. Adrian says:

    hi,
    first of all thank you very much for the SEO solution!
    I have a question when using a dynamic xml in index.php I use $ siteXML = “xml/site.php” and works perfectly.

    The problem is when I pass a parameter .. fails
    $ siteXML = “xml/site.php?lang=es”;

    Do you know what I’m doing wrong?

    thanks!

  21. admin says:

    Hi Adrian

    Difficult to say! I don’t see why dou you have to pass the language parameter. I do the language switch in index.php and then either use $siteXML=site_es.xml or $siteXML=site_en.xml.

  22. Adrian says:

    thanks for answering!
    the issue is that I will have different content in 6 languages and 20 countries and it is necessary to generate the xml dynamically from a mysql query
    $siteXML= “xml/site.php?country=uk&lang=en”;

    thanks!!

  23. Adrian says:

    Fixed!
    The problem was that php was not calling with the absolute path

    $siteXML = “http://www.website.com/xml/site.php?country=es&lang=es”;

    thanks a lot!!

  24. admin says:

    Perfect! :-)

  25. Niklas says:

    Hi there Christian!
    I must say that I’m very impressed by your work. Especially the different back end solutions – like the cms for example.
    Two questions – at the moment the solution above seems a little bit over my head when it comes to understanding & working with php etc.
    In the Gaia forum you talk about changing code in the main.as & GaiaSWFAddress.as… Are these the only changes you need to make if you don’t want the dynamically created menu etc. from the example above & still run the SWFaddress seo-example?
    One more question:
    Wouldn’t it be possible to use a 303 redirect in the .htaccess file for the home page (since gaia is adding to the home – like this: http://www.you.com/#/home & the SWFaddress seo-example is using a cleaner url http://www.you.com/). So you just do a 303 redirect for http://www.you.com/#/home to http://www.you.com/ or would this be bad SEO-wise?

    All the best, Niklas

  26. Niklas says:

    Oh – sorry I didn’t mean http://www.you.com/#/home but instead http://www.you.com/home (when javascript is disabled)…

  27. admin says:

    Hi Niklas!

    The changes I did to the Gaia classes were the only ones, but you only need them if you need to retrieve the language out of the url by using swfaddress before the site.xml is being loaded. Otherwise you don’t have to touch the Gaia classes. The thing with the not needed “home” in the url was discussed in the Gaia forum somewhere, but this will not be changed, so you have to stick with that or code a work around. At the moment I’m working on a more advanced seo/flash with swfaddress solution. I’ll post it as soon as I have finished it!

    Cheers,
    Christian

  28. Niklas says:

    Hi there Christian!
    Thanks for your answer.
    It will be very interesting to see your SEO solution for sure!
    This was somewhat of an eyeopener to me. It seems like I had misunderstood the whole solution… So I realised that the same thing is happening in your example as well regarding the “clean” homepage. But this means that the “clean” URL will give a result of “content not found”…hmmm. I will try this with a 303 redirect i .htaccess.

    Niklas

  29. Flash CMS says:

    thank you for the workaround.. nowadays flash websites are not really seo friendly.. but I see that they starting to be :)

Leave a Reply

Comment Spam Protection by WP-SpamFree