Multiple Domains / Cookies / Apache

Multiple domains ...

Can this work ...

Route say 3 domains to 1

www.site1.com
www.site2.com
www.site3.com

all route to

www.site.com

but have a cookie be shared among all the domains? so if i visit www.site1.com and tag the session with that site ... then they visit another of the sites (say www.site2.com) that the session holds the site1.com tag?

can this be done using something like virtual hosts or sub-domains? i have a dedicated box with root access so I can virtually do anything.

===

also i dont want to use a frame redirection/domain masking for these... i want each site to show in the URL as if they would a regular site ...
LVL 1
guitarclapAsked:
Who is Participating?
 
periwinkleCommented:
You didn't mention that you were using cpanel :)  Cpanel parks domains by pointing them to the same directory structure as your main site :)
0
 
periwinkleCommented:
Strictly speaking, the answer would be no;  cookies are only accessible by the domain that sets them.  However, you COULD set cookies on all of the domains in a round robin fashion by use of a script of some sort.  Basically, you'd have a bit of code that passes through the identifier to the next domain, and a bit of code on the next server that would read that information and set the cookie.
0
 
guitarclapAuthor Commented:
Yeah, I was thinking that ... how could i setup my apache to route that 3 domains to 1 ? virtual hosts keep rining but I don tknow much
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
periwinkleCommented:
Are all three domains going to use the same website?
0
 
guitarclapAuthor Commented:
Yes.. would like to setup the 3 domains to point to the main domain through it's DNS
0
 
periwinkleCommented:
You would set up the virtual hosts for each domain to all point to the same directory structure.  

However, that doesn't help with the cookie issue.  I'm thinking, however, that maybe there's a mod-rewrite solution for that... basically, the idea being is that you keep the domain that they requested on the location bar, but underneath, the requests are all funnelled to one domain.

I'm not, however, a mod_rewrite expert - hopefully one will step in soon.
0
 
guitarclapAuthor Commented:
Yeah don't worry about the cookies.  That is impossible. But I woud like to get it setup with the domains routings.
0
 
guitarclapAuthor Commented:
SOLVED..

cpanel / parked domains ... does it exactly...
0
 
guitarclapAuthor Commented:
Sorry :) Thanks for your help, though.  The cookie situation has been axed -- it isn't necessary to preserve them anymore. Thanks again
0
 
periwinkleCommented:
glad to have tried to help;  very kind of you to award the points.  Good luck with your site!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.