[ic] Redirecting Based on Domain

interchange-users@interchange.redhat.com interchange-users@interchange.redhat.com
Wed Jan 2 16:23:01 2002


On Wed, Jan 02, 2002 at 02:20:09PM -0500, Michael Stearne wrote:
> Jason Kohles wrote:
> 
> >On Wed, Jan 02, 2002 at 01:31:33PM -0500, Michael Stearne wrote:
> >
> >>I was thinking about mod_rewrite and may do that, but was also looking 
> >>for an Interchange way to do it so if the application was moved there 
> >>would be less things to configure (Interchange AND Apache).  But I will 
> >>look at both.  
> >>
> >
> >There isn't an Interchange way to do it, because the request doesn't even
> >hit Interchange until after the redirect happens, so it must be done in the
> >web server.
> >
> That's true sine I gave the example of am.mydomain.com points to 
> www.mydomain.com/fea/.... where it wouldn't hit Interchange at the main 
> request.  I will probably be looking into mod_rewrite again.  


You might be able to CNAME all the subdomains and straighten out the
mess in IC on the first page.


> 
> One question though, while using Perl (or ITL) code in ITL can I get the 
> server name (HTTP_HOST) or any of the other environment variables?
> 
> Thanks,
> Michael
> 
> >
> >>Thanks,
> >>Michael
> >>
> >>Jonathan Melhuish wrote:
> >>
> >>>On Wednesday 02 January 2002 11:45, you wrote:
> >>>
> >>>>I have to do some redirecting of the user based on which URL they use to
> >>>>some into my site with based on subdomain name.  For example:
> >>>>
> >>>>http://am.mydomain.com/
> >>>>
> >>>>should be replaced with
> >>>>
> >>>>http://www.mydomain.com/fea/index.html?linecode=AM
> >>>>
> >>>Assuming you are running Apache, you could do this with a Rewrite rule 
> >>>in your httpd.conf.  This would have the advantage of being instantly 
> >>>applicable to any subdomain, which could be significantly easier than 
> >>>putting different re-direct pages on the server for each subdomain (and 
> >>>setting up virtual hosts for each).
> >>>
> >>>The only down side is that mod_rewrite, whilst extremely powerful, is 
> >>>very complicated (bit like Interchange, really), to the extent that 
> >>>understanding it requires a fair bit of effort.  So my advice is either 
> >>>to read the following links and to try and learn it, or, much easier, 
> >>>find somebody kind who understands it already!
> >>>
> >>>http://httpd.apache.org/docs/mod/mod_rewrite.html
> >>>http://httpd.apache.org/docs/misc/rewriteguide.html
> >>>
> >>>Jon
> >>>_______________________________________________
> >>>interchange-users mailing list
> >>>interchange-users@interchange.redhat.com
> >>>http://interchange.redhat.com/mailman/listinfo/interchange-users
> >>>
> >>>
> >>
> >>
> >>_______________________________________________
> >>interchange-users mailing list
> >>interchange-users@interchange.redhat.com
> >>http://interchange.redhat.com/mailman/listinfo/interchange-users
> >>
> >
> 
> 
> 
> _______________________________________________
> interchange-users mailing list
> interchange-users@interchange.redhat.com
> http://interchange.redhat.com/mailman/listinfo/interchange-users

-- 

Christopher F. Miller, Publisher                               cfm@maine.com
MaineStreet Communications, Inc           208 Portland Road, Gray, ME  04039
1.207.657.5078                                         http://www.maine.com/
Content/site management, online commerce, internet integration, Debian linux