Options +FollowSymLinks
RewriteEngine on

RewriteRule ^/?$ %{REQUEST_URI}affiliate-information.php [R=permanent,L]


RewriteCond %{QUERY_STRING} ^url=(.*)&referer=(.*)
RewriteRule ^([0-9]+)\.html landing.php?aid=$1&returnUrl=%1&referer=%2 [L]

RewriteCond %{QUERY_STRING} ^url=(.*)
RewriteRule ^([0-9]+)\.html landing.php?aid=$1&returnUrl=%1 [L]

RewriteCond %{QUERY_STRING} ^referer=(.*)
RewriteRule ^([0-9]+)\.html landing.php?aid=$1&referer=%1 [L]


RewriteCond %{QUERY_STRING} ^url=(.*)&referer=(.*)
RewriteRule ^([0-9]+)-([0-9]*)\.html landing.php?aid=$1-$2&returnUrl=%1&referer=%2 [L]

RewriteCond %{QUERY_STRING} ^url=(.*)
RewriteRule ^([0-9]+)-([0-9]*)\.html landing.php?aid=$1-$2&returnUrl=%1 [L]

RewriteCond %{QUERY_STRING} ^referer=(.*)
RewriteRule ^([0-9]+)-([0-9]*)\.html landing.php?aid=$1-$2&referer=%1 [L]


RewriteRule ^([0-9]+)\.html landing.php?aid=$1 [L]

RewriteRule ^([0-9]+)-([0-9]*)\.html landing.php?aid=$1-$2 [L]


RewriteRule ^/?datafiles/(.+)\.(php|cgi) 404.php [L]
RewriteRule ^/?themes/(.+)\.(php|cgi) 404.php [L]