LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Apache2 .htaccess redirect problem (https://www.linuxquestions.org/questions/linux-networking-3/apache2-htaccess-redirect-problem-575010/)

raven 08-06-2007 02:35 AM

Apache2 .htaccess redirect problem
 
Hello

I am trying to implement conditional redirects on my webserver (Apache2 on debian sarge) in a .htaccess file. This is my first time working with .htaccess at all, so from this point of view I am a noob.

What I want: based on accept-language I'd like to redirect the user:

if accept-language==de
redirect_from: www.somehost.com to www.somehost.com/german.html
elsif accept-language==fr
redirect_from: www.somehost.com to www.somehost.com/french.html
else
dont't redirect.

I was trying to do so by using something like this:

RewriteEngine on
RewriteCond %{HTTP: accept-language} (de)
RewriteRule $1 $1/german.html [(option for appending -> can't remember anymore),L]

Of course, this gave me infinite redirects...

But I have no clue how I can do this. Any hints?

Thanks.


All times are GMT -5. The time now is 09:23 PM.