LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 08-06-2007, 02:35 AM   #1
raven
Member
 
Registered: Dec 2001
Location: Basel, Switzerland
Distribution: ubuntu
Posts: 297

Rep: Reputation: 31
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
.htaccess - whats wrong with this redirect syntax? neocontrol Linux - Server 3 03-16-2007 02:55 PM
Apache2 htaccess problem ghostz00 Linux - Server 3 11-26-2006 11:18 PM
Apache2 .htaccess problem suse 10.0 PB0711 Linux - Networking 2 07-12-2006 11:23 AM
htaccess 'redirect permanent' failing mikeindo Linux - Networking 0 07-07-2005 01:05 AM
Htaccess with a redirect Diode Linux - Networking 0 10-28-2003 06:23 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 04:29 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration