• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 247
  • Last Modified:

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 ...
0
guitarclap
Asked:
guitarclap
  • 5
  • 5
1 Solution
 
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
 
periwinkleCommented:
Are all three domains going to use the same website?
0
NEW Veeam Backup for Microsoft Office 365 1.5

With Office 365, it’s your data and your responsibility to protect it. NEW Veeam Backup for Microsoft Office 365 eliminates the risk of losing access to your Office 365 data.

 
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
 
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
 
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

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 5
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now