Hi All, I have a web site which has 2 domains ex : www.site1.com www.site2.com (which will forward to www.site1.com with domain masking) www.site1.com is where the actual web server rungs www.site2.com is just a domain name forwarder and I use mask to make the user feel he/she is in www.site2.com even though he/she is in www.site1.com But in underlying code I want to distinguish both the request (who came from www.site1.com and who came from www.site2.com) so that I can load their UI accrodingly I tried request.host as well as request.referrer which always gives www.site1.com and when I get the source code of the www.site2.com (which redirects to site1) it has this, <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>sameera gayan </title> <META name="description" content="test"><META name="keywords" content="test"> </head> <frameset rows="100%,*" border="0"> <frame src="http://www.site1.com" frameborder="0" /> <frame frameborder="0" noresize /> </frameset> <!-- pageok --> <!-- 04 --> <!-- --> </html> So what is the best option for getting the 2 different site URL''s , thanks in advance cheers, Sameera -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Sameera, You will need to write some JS (document.referrer) to include the referrer in the URL when you do the redirect to the second site. Then on the second site, you will need to extract the URL from the query string. Make sense? Darian Shimy -- http://www.darianshimy.com http://twitter.com/dshimy On Mon, Nov 30, 2009 at 11:33 AM, sameera <sameera207-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi All, > > I have a web site which has 2 domains > > ex : www.site1.com > www.site2.com (which will forward to www.site1.com with domain > masking) > > > www.site1.com is where the actual web server rungs > > www.site2.com is just a domain name forwarder and I use mask to make > the user feel he/she is in www.site2.com even though he/she is in > www.site1.com > > But in underlying code I want to distinguish both the request (who > came from www.site1.com and who came from www.site2.com) so that I can > load their UI accrodingly > > I tried request.host as well as request.referrer which always gives > www.site1.com > > and when I get the source code of the www.site2.com (which redirects > to site1) it has this, > > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" > "http://www.w3.org/TR/html4/strict.dtd"> > <html> > > <head> > <title>sameera gayan </title> > <META name="description" content="test"><META name="keywords" > content="test"> > </head> > <frameset rows="100%,*" border="0"> > <frame src="http://www.site1.com" frameborder="0" /> > <frame frameborder="0" noresize /> > </frameset> > > <!-- pageok --> > <!-- 04 --> > <!-- --> > </html> > > > So what is the best option for getting the 2 different site URL''s , > > thanks in advance > > cheers, > Sameera > > -- > > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. > > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Mon, Nov 30, 2009 at 8:33 PM, sameera <sameera207-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi All, > > and when I get the source code of the www.site2.com (which redirects > to site1) it has this, > > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" > "http://www.w3.org/TR/html4/strict.dtd"> > <html> > > <head> > <title>sameera gayan </title> > <META name="description" content="test"><META name="keywords" > content="test"> > </head> > <frameset rows="100%,*" border="0"> > <frame src="http://www.site1.com" frameborder="0" /> > <frame frameborder="0" noresize /> > </frameset> > > <!-- pageok --> > <!-- 04 --> > <!-- --> > </html> > > > So what is the best option for getting the 2 different site URL''s , > > thanks in advance > > cheers, > Sameera > > -- > >This is not the best in doing such things. In this case, it''s logical that you never see ''site2.com'' in your request.host attribute. First of all, in your DNS both ''site1.com'' & ''site2.com'' should point the same ip address. Then on your server, you should configure your webserver that both '' site1.com'' & ''site2.com'' urls point to the same directory and then you can access the request.host which the right hostname set. Cya C+++ -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.