Multiple Domains / Cookies / Apache

Multiple domains ...

Can this work ...

Route say 3 domains to 1

all route to

but have a cookie be shared among all the domains? so if i visit and tag the session with that site ... then they visit another of the sites (say that the session holds the 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 ...
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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.
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
Are all three domains going to use the same website?
IT Pros Agree: AI and Machine Learning Key

We’d all like to think our company’s data is well protected, but when you ask IT professionals they admit the data probably is not as safe as it could be.

guitarclapAuthor Commented:
Yes.. would like to setup the 3 domains to point to the main domain through it's DNS
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.
guitarclapAuthor Commented:
Yeah don't worry about the cookies.  That is impossible. But I woud like to get it setup with the domains routings.
guitarclapAuthor Commented:

cpanel / parked domains ... does it exactly...
You didn't mention that you were using cpanel :)  Cpanel parks domains by pointing them to the same directory structure as your main site :)

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
guitarclapAuthor Commented:
Sorry :) Thanks for your help, though.  The cookie situation has been axed -- it isn't necessary to preserve them anymore. Thanks again
glad to have tried to help;  very kind of you to award the points.  Good luck with your site!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Apache Web Server

From novice to tech pro — start learning today.