You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Albert Vila <av...@imente.com> on 2004/11/09 09:18:55 UTC

[users@httpd] Subdomains and mod_rewrite

Hi all, 

 I'm currently have an apache web server serving the following urls:
   - www.mydomain.com/location/spain_1.html
   - www.mydomain.com/location/french_2.html
   - www.mydomain.com/category/list_houses_11.html

 I've got the RewriteRule ^/location/([a-z_\(\)]*)([0-9]+).html /.../web/index.cgi?location=$2 [L] in order to change the main
location. This location is stored in a client cookie, so the following call to www.mydomain.com/category/list_houses_11.html lists all houses from the correct location (the one selected by the user).
 I've got RewriteRule ^/category/([a-z_\(\)]*)([0-9]+).html /.../web/list.cgi?category_id=$2 [L] to see the category list.

 Now, I wanna change the above urls for:
   - spain.mydomain.com
   - french.mydomain.com
   - spain.mydomain.com/category/list_houses_11.html

 What do I have to do to achive that transparently? I don't wanna tranlate the urls to the old ones, the user must see the spain.mydomain.com/... always.
 I can do it using the apache mod_rewrite, or I need something else. I'm currently have the DNS propertly configured.

 Thanks in advance.

Albert

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


Re: [users@httpd] Subdomains and mod_rewrite

Posted by Albert Vila <av...@imente.com>.
This solution does not solve my problem.
It translates the old url to the new ones, and this is not what I wanted.

I want to use the new urls, not the old ones.
I want my users to surf using the spain.mydomain.com, 
spain.mydomain.com/category/list_houses_11.html, ....

My problem is how to map the spain.mydomain.com to 
www.mydomain.com/location/spain_1.html without changing the url 
(transparently for the user).

I can do the RewriteRule ^/ /.../web/index.cgi?location=1 [L] but this 
changes all urls in the spain.mydomain.com virtual host.

Albert

Eimantas Vaiciunas wrote:

>On Tuesday 09 November 2004 10:18, Albert Vila wrote:
>  
>
>>Hi all,
>>
>> I'm currently have an apache web server serving the following urls:
>>   - www.mydomain.com/location/spain_1.html
>>   - www.mydomain.com/location/french_2.html
>>   - www.mydomain.com/category/list_houses_11.html
>>
>> I've got the RewriteRule ^/location/([a-z_\(\)]*)([0-9]+).html
>>/.../web/index.cgi?location=$2 [L] in order to change the main location.
>>This location is stored in a client cookie, so the following call to
>>www.mydomain.com/category/list_houses_11.html lists all houses from the
>>correct location (the one selected by the user). I've got RewriteRule
>>^/category/([a-z_\(\)]*)([0-9]+).html /.../web/list.cgi?category_id=$2 [L]
>>to see the category list.
>>
>> Now, I wanna change the above urls for:
>>   - spain.mydomain.com
>>   - french.mydomain.com
>>   - spain.mydomain.com/category/list_houses_11.html
>>    
>>
>RewriteRule ^/location/([a-z_\(\)]*)([0-9]+).html 
>http://$1.yourdomain.com/index.cgi?location=$2 [L]
>
>---------------------------------------------------------------------
>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


Re: [users@httpd] Subdomains and mod_rewrite

Posted by Eimantas Vaiciunas <ei...@sc.vu.lt>.
On Tuesday 09 November 2004 10:18, Albert Vila wrote:
> Hi all,
>
>  I'm currently have an apache web server serving the following urls:
>    - www.mydomain.com/location/spain_1.html
>    - www.mydomain.com/location/french_2.html
>    - www.mydomain.com/category/list_houses_11.html
>
>  I've got the RewriteRule ^/location/([a-z_\(\)]*)([0-9]+).html
> /.../web/index.cgi?location=$2 [L] in order to change the main location.
> This location is stored in a client cookie, so the following call to
> www.mydomain.com/category/list_houses_11.html lists all houses from the
> correct location (the one selected by the user). I've got RewriteRule
> ^/category/([a-z_\(\)]*)([0-9]+).html /.../web/list.cgi?category_id=$2 [L]
> to see the category list.
>
>  Now, I wanna change the above urls for:
>    - spain.mydomain.com
>    - french.mydomain.com
>    - spain.mydomain.com/category/list_houses_11.html
RewriteRule ^/location/([a-z_\(\)]*)([0-9]+).html 
http://$1.yourdomain.com/index.cgi?location=$2 [L]

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