Forum Moderators: phranque
Thanks your time and input!
Your post has been waiting for awhile, so I'll give it a shot, although we prefer that you post your own ocde for comment. Assuming that you're familiar with the setup and use of mod_rewrite:
RewriteCond %{HTTP_HOST} ^example\.com
RewriteRule (.*) http://www.example.com/$1 [R=301,L]
#
RewriteCond %{HTTP_HOST} !^www\.example\.com
RewriteCond %{HTTP_HOST} ^([^.]+)\.example\.com
RewriteRule ^$ /AAA/BBB/index.php?udn=%1 [L]
#
RewriteCond %{HTTP_HOST} !^www\.example\.com
RewriteCond %{HTTP_HOST} ^([^.]+)\.example\.com
RewriteRule ^funny$ /AAA/BBB/funny.php?udn=%1 [L]
For more information, see the documents cited in our forum charter [webmasterworld.com] and the tutorials in the Apache forum section of the WebmasterWorld library [webmasterworld.com].
Jim