welcome to WebmasterWorld [webmasterworld.com],
tbrim20!
i think this would work:
- you create a script that runs under the old domain and internally rewrite all appropriate requests to this script, redirecting all other requests (images, etc) to the new domain.
- the script looks for a cookie and redirects the request to the new domain with an additional parameter containing the cookie data; if no cookie exists the request is redirected to the new domain otherwise unmolested.
- on the new domain, requests containing the cookie parameter are internally rewritten to another script, which constructs a 301 response redirecting to the "cookieless" url and including the cookie.
to review, this should work thusly for search engines, new visitors and other requests with no cookies:
- "cookieless" request to old domain gets internally rewritten to script
- script 301 redirects request to new domain
(note: you could even use a RewriteCond to test for the cookie and skip the rewrite to script, just redirect to new domain)
- new domain provides a response with a new cookie
and for returning visitors that permit and have a cookie:
- request to old domain gets internally rewritten to script
- script 301 redirects request to new domain with additional cookie parameter
- request to new domain gets internally rewritten to script
- script provides a 301 response with a new cookie and no cookie parameter in the url.
- 2nd request to new domain now includes a cookie