Hello Friends, Just wanted to know how can i execute the following task My requirement is 1. Let say the main domain is www.maindomain.com 2. And a subdomain is e.g. xyz.maindomain.com and Every subdomain have a correspondence domain store in DB. so that user can access a site using that domain as well. For e.g let say there is a subdomain xyz.maindomain.com and this can be access using www.xyz.com So just wanted to know its need to be configured in .htaccess file or i''ll need to configure something else? NOTE: the subdomain will be dynamic. Thanks Abhis --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
If you have a domain maindomain then you got to do whatever you need within that domain. How can you use other''s domain?you can use subdomain on your maindomain but xyz is some other domain. You can''t use that to redirect to your domain by anyway. On Aug 24, 6:33 pm, Abhishek shukla <bettera...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hello Friends, > Just wanted to know how can i execute the following task > > My requirement is > > 1. Let say the main domain iswww.maindomain.com > 2. And a subdomain is e.g. xyz.maindomain.com and Every subdomain have a > correspondence domain store in DB. so that user can access a site using that > domain as well. > For e.g let say there is a subdomain xyz.maindomain.com and this can be > access usingwww.xyz.com > > So just wanted to know its need to be configured in .htaccess file or i''ll > need to configure something else? > > NOTE: the subdomain will be dynamic. > > Thanks > Abhis
ok let me be more specific I have two domain which in pointing to my rails application and a subdomain 1. www.xyz.com 2. www.xyz.info 3. example.xyz.com Now when the user access www.xyz.info the example.xyz.com page should open up but the address bar should be www.xyz.info. So is it possible to redirect? Thanks Abhi On 8/25/09, prabesh shrestha <prabesh708-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > If you have a domain maindomain then you got to do whatever you need > within that domain. > How can you use other''s domain?you can use subdomain on your > maindomain but xyz is some other domain. > You can''t use that to redirect to your domain by anyway. > > On Aug 24, 6:33 pm, Abhishek shukla <bettera...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> Hello Friends, >> Just wanted to know how can i execute the following task >> >> My requirement is >> >> 1. Let say the main domain iswww.maindomain.com >> 2. And a subdomain is e.g. xyz.maindomain.com and Every subdomain have a >> correspondence domain store in DB. so that user can access a site using >> that >> domain as well. >> For e.g let say there is a subdomain xyz.maindomain.com and this can be >> access usingwww.xyz.com >> >> So just wanted to know its need to be configured in .htaccess file or i''ll >> need to configure something else? >> >> NOTE: the subdomain will be dynamic. >> >> Thanks >> Abhis > > >
On Tue, Aug 25, 2009 at 11:58 PM, Abhishek shukla<betterabhi-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I have two domain which in pointing to my rails application and a subdomain > 1. www.xyz.com > 2. www.xyz.info > 3. example.xyz.comActually, no. You have three host names. "xyz.com" and "xyz.info" are domain names. "example.xyz.com" /could/ be a subdomain, if you have hosts within that subdomain like ''ren.example.xyz.com'', ''stimpy.example.xyz.com''-- but I''m betting that''s not the case.> Now when the user access www.xyz.info the example.xyz.com page should > open up but the address bar should be www.xyz.info. > > So is it possible to redirect?Why don''t you just alias (in DNS) one to the other? And no, it''s not possible to "redirect" and have the url in the address bar remain the same. -- Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org twitter: @hassan
On 8/26/09, Hassan Schroeder <hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > On Tue, Aug 25, 2009 at 11:58 PM, Abhishek shukla<betterabhi-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: > >> I have two domain which in pointing to my rails application and a >> subdomain >> 1. www.xyz.com >> 2. www.xyz.info >> 3. example.xyz.com > > Actually, no. You have three host names. "xyz.com" and "xyz.info" > are domain names. "example.xyz.com" /could/ be a subdomain, if > you have hosts within that subdomain like ''ren.example.xyz.com'', > ''stimpy.example.xyz.com''-- but I''m betting that''s not the case. > >> Now when the user access www.xyz.info the example.xyz.com page should >> open up but the address bar should be www.xyz.info. >> >> So is it possible to redirect? > > Why don''t you just alias (in DNS) one to the other? > > And no, it''s not possible to "redirect" and have the url in the address > bar remain the same. > > -- > Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org > twitter: @hassan > > > >
On Wed, Aug 26, 2009 at 3:24 AM, Hassan Schroeder<hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> And no, it''s not possible to "redirect" and have the url in the address > bar remain the same.This is exactly what Apache''s mod_rewrite does. You send it a url and it rewrites the request to the actual resource. RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} ^old.com$ RewriteRule ^(.*) httq://new.com/$1 [L,R=301] -- Greg Donald http://destiney.com/
On Wed, Aug 26, 2009 at 8:37 AM, Greg Donald<gdonald-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:>> And no, it''s not possible to "redirect" and have the url in the address >> bar remain the same. > > This is exactly what Apache''s mod_rewrite does. You send it a url and > it rewrites the request to the actual resource.If a server sends a 30x redirect response to a client, it instructs that client to send a new request to the provided URL, which will then be visible in the client''s address bar (if it has one). Forwarding "under the covers" is a different beast. -- Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org twitter: @hassan
This is mostly about Apache (or equivalent) settings higher up than .htaccess - look around for documents regarding "name-based virtual hosting". It''s quite possible to set up - pretty much every shared webhost out there is doing it. --Matt Jones On Aug 26, 2:58 am, Abhishek shukla <bettera...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> ok let me be more specific > > I have two domain which in pointing to my rails application and a subdomain > 1.www.xyz.com > 2.www.xyz.info > 3. example.xyz.com > > Now when the user accesswww.xyz.infothe example.xyz.com page should > open up but the address bar should bewww.xyz.info. > > So is it possible to redirect? > > Thanks Abhi > > On 8/25/09, prabesh shrestha <prabesh...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > If you have a domain maindomain then you got to do whatever you need > > within that domain. > > How can you use other''s domain?you can use subdomain on your > > maindomain but xyz is some other domain. > > You can''t use that to redirect to your domain by anyway. > > > On Aug 24, 6:33 pm, Abhishek shukla <bettera...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> Hello Friends, > >> Just wanted to know how can i execute the following task > > >> My requirement is > > >> 1. Let say the main domain iswww.maindomain.com > >> 2. And a subdomain is e.g. xyz.maindomain.com and Every subdomain have a > >> correspondence domain store in DB. so that user can access a site using > >> that > >> domain as well. > >> For e.g let say there is a subdomain xyz.maindomain.com and this can be > >> access usingwww.xyz.com > > >> So just wanted to know its need to be configured in .htaccess file or i''ll > >> need to configure something else? > > >> NOTE: the subdomain will be dynamic. > > >> Thanks > >> Abhis