You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Craig Rose <cr...@webzonic.com> on 2002/09/02 01:40:24 UTC

[users@httpd] Redirecting by languare with .htaccess

I'm trying to direct traffic thru language with .htaccess. I've read up as
much as I can but I cannot find anything that will specifically help.

What I'm trying to do is:

Have all the brousers that are "en" enabled stay at my site.
All the ones that are "it" enabled to go to a different page on my site
All the ones that are "de" enabled to go to another different page on my
site
And the remainder redirect to a completely different site.

This is what I wrote, but it does not work.

RewriteEngine on
Options +FollowSymlinks
RewriteBase /
RewriteCond %{HTTP:Accept-Language} !^en [NC]
RewriteRule ^(.it) http://www.mysite.com/o.php?site=coolpp.com
RewriteRule ^(.de) http://www.mysite.com/o.php?site=onlineexit.com
RewriteRule ^(.*) http://php.adifferentsite.com/activex.php?u=referal

Could anyone tell me what I'm doing wrong? Or make any recomendations?

Thanks,

Craig Rose


---------------------------------------------------------------------
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] Redirecting by language with .htaccess

Posted by Craig Rose <cr...@webzonic.com>.
Thanks I'll give this a try and see what the log shows.

Much appreciated

Craig Rose
Web-Zonic, Inc.
http://www.webzonic.com

CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, is
for the sole use of the intended recipient(s) and may contain confidential
and privileged information. Any unauthorized review, use, disclosure or
distribution is prohibited.

If you are not the intended recipient, please contact the sender by reply
e-mail and destroy all copies of the original message.



-----Original Message-----
From: Joshua Slive [mailto:joshua@slive.ca]
Sent: Sunday, September 01, 2002 5:13 PM
To: users@httpd.apache.org
Subject: Re: [users@httpd] Redirecting by languare with .htaccess


Craig Rose wrote:

> Have all the brousers that are "en" enabled stay at my site.
> All the ones that are "it" enabled to go to a different page on my site
> All the ones that are "de" enabled to go to another different page on my
> site
> And the remainder redirect to a completely different site.
>
> This is what I wrote, but it does not work.
>
> RewriteEngine on
> Options +FollowSymlinks
> RewriteBase /
> RewriteCond %{HTTP:Accept-Language} !^en [NC]
> RewriteRule ^(.it) http://www.mysite.com/o.php?site=coolpp.com
> RewriteRule ^(.de) http://www.mysite.com/o.php?site=onlineexit.com
> RewriteRule ^(.*) http://php.adifferentsite.com/activex.php?u=referal
>
> Could anyone tell me what I'm doing wrong? Or make any recomendations?

RewriteRule's match URL-Paths, and nothing else.

RewriteCond %{HTTP:Accept-Language} !en [NC]
RewriteCond %{HTTP:Accept-Language} it [NC]
RewriteRule .* http://www.mysite.com/o.php?site=coolpp.com [R,L]

RewriteCond %{HTTP:Accept-Language} !en [NC]
RewriteCond %{HTTP:Accept-Language} de [NC]
RewriteRule .* http://www.mysite.com/o.php?site=onlineexit.com [R,L]

RewriteCond %{HTTP:Accept-Language} !en [NC]
RewriteRule .* http://php.adifferentsite.com/activex.php?u=referal

Use the RewriteLog to see exactly what is working and what isn't.

Joshua.





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



---------------------------------------------------------------------
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] Redirecting by languare with .htaccess

Posted by Joshua Slive <jo...@slive.ca>.
Craig Rose wrote:

> Have all the brousers that are "en" enabled stay at my site.
> All the ones that are "it" enabled to go to a different page on my site
> All the ones that are "de" enabled to go to another different page on my
> site
> And the remainder redirect to a completely different site.
> 
> This is what I wrote, but it does not work.
> 
> RewriteEngine on
> Options +FollowSymlinks
> RewriteBase /
> RewriteCond %{HTTP:Accept-Language} !^en [NC]
> RewriteRule ^(.it) http://www.mysite.com/o.php?site=coolpp.com
> RewriteRule ^(.de) http://www.mysite.com/o.php?site=onlineexit.com
> RewriteRule ^(.*) http://php.adifferentsite.com/activex.php?u=referal
> 
> Could anyone tell me what I'm doing wrong? Or make any recomendations?

RewriteRule's match URL-Paths, and nothing else.

RewriteCond %{HTTP:Accept-Language} !en [NC]
RewriteCond %{HTTP:Accept-Language} it [NC]
RewriteRule .* http://www.mysite.com/o.php?site=coolpp.com [R,L]

RewriteCond %{HTTP:Accept-Language} !en [NC]
RewriteCond %{HTTP:Accept-Language} de [NC]
RewriteRule .* http://www.mysite.com/o.php?site=onlineexit.com [R,L]

RewriteCond %{HTTP:Accept-Language} !en [NC]
RewriteRule .* http://php.adifferentsite.com/activex.php?u=referal

Use the RewriteLog to see exactly what is working and what isn't.

Joshua.





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