Hey guys, I've got a full Flash website that's deeplinked and I'm working on a php script that will dynamically generate the alternate content on the page.
I can't get the SEO version of swfaddress to work so I'm trying to go around another way.
This is how it works so far - my crawlable links are like this:
mydomain.com?id=video -----> is rewritten as: mydomain.com/video/
The php script reads the id and prepares the appropriate content. Problem is, when users click on the flash content, their urls appear like this:
mydomain.com/video/#contact,
mydomain.com/video/#about-us etc etc
Which is confusing. Is there a way to get rid of "/video/" in the uri path with PHP or javascript? Any ideas or not possible?
To anyone who may be in the same position as me; struggling to understand Asual's swfAddress SEO solution I've reached a satisfactory conclusion.
I've used a single index.php and supporting datasource.php which contains all results in a switch statement. The switch statement is called first in the index.php and runs through collecting the following info from an id (eg. ?id=video) sent via GET. The switch statement then continues to match up appropriate content, setting variables for the rest of the script to use. I've used the following:
$title
$description
$keywords
$canonical // hint: -> 'domain/video?id=somevid' to 'domain.com/video/' (see canonical in google)
$stylesheet
$body
After the datasource.php, I include a "head.php" below it, which gets the html rolling, doctype etc (but is mostly concerned with the < head >) and lays out the keywords, description and content, specific to that page.
Swfaddress javascript will set the deeplinking upon entry for Flash users:
SWFAddress.setValue(< ?php echo "/$id" ?>); // eg."/video"
The index.php uses swfobject to embed - I use static embedding (I heard somewhere it was better for SE, more future proof but who knows, I prefer it though). The alternate content is a div, which echos the stored $body extracted earlier.
Finally I use mod_rewrite to setup my crawlable links. During testing I'm referencing my files directly.
< IfModule mod_rewrite.c >
Options +FollowSymLinks
Options +Indexes
RewriteEngine On
RewriteBase /
< /ifModule >
This ensures my links look like this: http://www.mydomain.com/video/
Which results in: http://mydomain.com?id=video
A search engine can crawl it perfectly, viewing only the html content where as users will see the flash, and when they click on the links they will see something like this:
http://www.mydomain.com/video/#/contact
As I said it's satisfactory, not as ideal as Asual's SEO solution, but clean enough. I couldn't find ANY information on swfaddress' SEO sample anywhere, and I certainly don't know enough php to dive into the vast uncommented code.
Oh, be sure to include this in the head of your index.php, it will ensure your links don't screw up when your swfs load external files.
< base href="http://www.mydomain.com/" />
Hope that helps someone at some point.