You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Boyle Owen <Ow...@swx.com> on 2004/09/08 11:08:09 UTC

RE: [users@httpd] Subdomain with scriptalias - really Redirect?

> -----Original Message-----
> From: Albert Vila [mailto:avp@imente.com]
> 
> First of all, sorry for my poor english.

It wasn't a question of language - just logic...

> 
> I've got a website like www.mydomain.com. This website has multiple 
> subsections with multiple locations (spain, france, ...).
> 
> Now, in order to change the location, the user clicks on the 
> france link 
> (http://www.mydomain.com/?location=france). I don't want 
> that. I wanna 
> change the location using the http://france.mydomain.com.
> 
> Then, I was asking if using the apache configuration I can do this 
> transparently.
> 
> france.mydomain.com --> www.mydomain.com/?location=france.
> 
> I don't want the user see ?location=france.

First of all; Is there some reason why you can't simply put "http://france.mydomain.com" into the link on the webpage? Why do you need to bother with the CGI at all?

Assuming there is, then would a Redirect solve your problem? There are a few ways to do this:

- In the CGI, just send a redirect response: eg, (in Perl)

print "Location:  http://france.mydomain.com \n\n";

- In the config, map the link using Redirect:

Redirect /your-link http://france.mydomain.com

see for details: http://httpd.apache.org/docs/mod/mod_alias.html#redirect

- use mod_rewrite, eg (untested):

RewriteCond  %{QUERY_STRING}  france$
RewriteRule  ^/$              http://france.mydomain.com    [R]

see for details; http://httpd.apache.org/docs/mod/mod_rewrite.html

Rgds,
Owen Boyle
Disclaimer: Any disclaimer attached to this message may be ignored. 


> 
> Thanks
> 
> Boyle Owen wrote:
> 
> >>-----Original Message-----
> >>From: Albert Vila [mailto:avp@imente.com]
> >>
> >>    I've got a domain www.mydomain.com, then I wanna create n 
> >>subdomains 
> >>by country, for example spain.mydomain.com, 
> >>france.mydomain.com, etc. I 
> >>can change the country manually using the 
> >>www.mydomain.com/index.cgi?country=id, but I wanna do that 
> >>automatically 
> >>every time the user change the url from xxx.mydomain.com to 
> >>yyy.mydomain.com.
> >>    
> >>
> >
> >I read your mail three times and still don't understand it.
> >
> >What exactly do you want to achieve? Write a narrative which 
> shows what
> >the user types and what you want to happen at each step. 
> Remember that
> >the audience has no prior knowledge of your website or what 
> you want to
> >do..
> >
> >Rgds,
> >Owen Boyle
> >Disclaimer: Any disclaimer attached to this message may be ignored. 
> >
> >  
> >
> >>    How can I achieve that transparently?
> >>
> >>
> >>Thank you.
> >>   
> >>
> >>
> >>------------------------------------------------------------
> ---------
> >>The official User-To-User support forum of the Apache HTTP 
> >>Server Project.
> >>See <URL:http://httpd.apache.org/userslist.html> for more info.
> >>To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> >>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
> >>For additional commands, e-mail: users-help@httpd.apache.org
> >>
> >>
> >>    
> >>
> >Diese E-mail ist eine private und persönliche Kommunikation. Sie hat
> >keinen Bezug zur Börsen- bzw. Geschäftstätigkeit der SWX Gruppe. This
> >e-mail is of a private and personal nature. It is not related to the
> >exchange or business activities of the SWX Group. Le présent 
> e-mail est
> >un message privé et personnel, sans rapport avec l'activité 
> boursière du
> >Groupe SWX.
> >
> >This message is for the named person's use only. It may contain
> >confidential, proprietary or legally privileged information. No
> >confidentiality or privilege is waived or lost by any 
> mistransmission.
> >If you receive this message in error, please notify the 
> sender urgently
> >and then immediately delete the message and any copies of it 
> from your
> >system. Please also immediately destroy any hardcopies of 
> the message.
> >You must not, directly or indirectly, use, disclose, 
> distribute, print,
> >or copy any part of this message if you are not the intended 
> recipient.
> >The sender's company reserves the right to monitor all e-mail
> >communications through their networks. Any views expressed in this
> >message are those of the individual sender, except where the message
> >states otherwise and the sender is authorised to state them to be the
> >views of the sender's company. 
> >
> >
> >
> >---------------------------------------------------------------------
> >The official User-To-User support forum of the Apache HTTP 
> Server Project.
> >See <URL:http://httpd.apache.org/userslist.html> for more info.
> >To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> >   "   from the digest: users-digest-unsubscribe@httpd.apache.org
> >For additional commands, e-mail: users-help@httpd.apache.org
> >
> >
> >
> >  
> >
> 
> -- 
> Albert Vila
> Director de proyectos I+D
> http://www.imente.com
> 902 933 242
> [iMente �La información con más beneficios�]
> 
> 
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP 
> Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 
> 

Diese E-mail ist eine private und persnliche Kommunikation. Sie hat keinen Bezug zur B rsen- bzw. Geschftst tigkeit der SWX Gruppe. This e-mail is of a private and personal nature. It is not related to the exchange or business activities of the SWX Group. Le prsent e-mail est un message priv  et personnel, sans rapport avec l'activit boursi re du Groupe SWX.