# Enables mod_rewrite
RewriteEngine on

# Sets the base folder of the Flash content
RewriteBase  /swfaddress/samples/seo/

# Detects the major search engines
RewriteCond  %{HTTP_USER_AGENT}     Googlebot|Msnbot|Slurp|Jeeves                                    [NC]
# Excludes real files and folders from rewriting
RewriteCond  %{REQUEST_URI}         !(index\.php|website\.swf|images|swfobject|seo/swfaddress)       [NC]
# Matches the root folder and ensures that rewriting won't be executed on /swfaddress/samples/seo
RewriteCond  %{REQUEST_URI}         /swfaddress/samples/seo/                                         [NC]
# Matches the query parameters
RewriteCond  %{QUERY_STRING}        (.*)
# Matches SWFAddress values and transforms them to a format that can be used by a serverside language
RewriteRule  ^(.+[^/])(/?)$         ?swfaddress=/$1/&%1                                              [NE]

# Excludes the major search engines
RewriteCond  %{HTTP_USER_AGENT}     !(Googlebot|Msnbot|Slurp|Jeeves)                                 [NC]
# Excludes real files and folders from rewriting
RewriteCond  %{REQUEST_URI}         !(index\.php|website\.swf|images|swfobject|seo/swfaddress)       [NC]
# Matches the root folder and ensures that rewriting won't be executed on /swfaddress/samples/seo
RewriteCond  %{REQUEST_URI}         /swfaddress/samples/seo/                                         [NC]
# Matches SWFAddress values and transforms them to a format that will be used by the browser
RewriteRule  ^(.+[^/])(/?)$         #/$1/                                                            [R,NE]
