htaccess browser language redirection

RewriteCond %{HTTP:Accept-Language} ^(en|de)$ [NC] RewriteCond %{HTTP_HOST} !^$ [NC] RewriteRule .* [R,L]

This code causes redirection loop error. I've debug second condition, which should prevent this, and both HOST and right side seems to be identical. This is 20th version or so, I run out of ideas.

Category:regex Time:2018-11-21 Views:0

Related post

  • How to redirect users based on browser language 2010-02-28

    I want to redirect users based on browser language, I figured out how to do this here, it works fine, here is the code(PHP): if(preg_match('/en-US/', $_SERVER['HTTP_USER_AGENT'])) header("location:index.php"); else header("location:http://cn.gearor.c

  • .htaccess : languages redirection 2010-08-06

    I'm trying to redirect visitors of my blog to either the french or the english version. So I made this .htaccess : <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / #--------------------- # Language Redirection #--------------------- # Ch

  • Can I use two separate browser-language-based RewriteCond's in .htaccess for root and subdomain 2011-08-15

    Can I use two separate browser-language-based RewriteCond's in .htaccess? One is for the domain root, one is for the subdomain 'm'. RewriteCond %{HTTP:Accept-Language} (cs) [NC] RewriteRule ^$ /index_cz.php [L,R=301] RewriteCond %{HTTP:Accept-Languag

  • Language Redirect with mod_rewrite 2011-05-31

    I have a site that is offered in 7 languages. I want to be able to redirect the user based on the browser language only when the user is visiting the homepage. This is meant for added usability when it comes to organic traffic. I need this redirect t

  • Browser language: autodetect vs user select? 2009-02-16

    I am designing a localized web app. I am leaning on auto-detect browser language setting. But I notice a number of respectable sites asking the user to select a language. Is there any usability issue you know of (from actual experiences out there) wi

  • htaccess rule for redirection of any particular name to particular page 2010-05-24

    I am using PHP and I need to use a name say "Pranav dave" in url which should redirect me to "myprofile.php" what should i do?.. also the url should display me "Pranav dave".. and what should be the htaccess rule to redirect any html file to php file

  • Detect Browser Language in PHP 2010-09-22

    I have this script as INDEX for my website. Script should be include on itself a specific page depending on browser language (automatically detected). This script was working till now, and now suddenly seems not working any more (I do not why), the p

  • Open site using default Browser Language Preference,developed in SharePoint 2007 2011-01-28

    We are developing multilingual site using SharePoint 2007. Now the requirement from client is whenerevr user access the site, the Site should be open in his browser using users browser Language Preference. Our current site is in English and Spanish.

  • Htaccess : How To Redirect https to http ignoring one folder 2011-05-02

    I just tried to add the following htaccess rules to redirect all https urls (www and non www) (except /wp-admin folder and everything inside it) to http (non www). But when its added, it started to give me redirection loops! Know why its happening? P

  • how to get the browser language using javascript 2011-11-20

    Possible Duplicate: JavaScript for detecting browser language preference i want to detect the language of the browser that is entering my site is it En or Fr so i can redirect to the En page or the other page and can i detect mobile language also ? -

  • HTTP Status code for language redirect 2011-11-30

    I wonder which HTTP Status code I should have to send in language redirects. I have the following php code to redirect via HTTP headers to most important language in Accept-Language browser header. <? $langs = array(); if (isset($_SERVER['HTTP_ACC

  • .htaccess: Authentication AND Redirect 2012-02-15

    I'm trying to redirect one of my domains to another one using .htaccess: RewriteEngine on RewriteRule !^admin($|/){REQUEST_URI} [L,R=301] As you can see, I don't want to redirect the given folder ("admin") because that directory

  • Browser is redirecting 2013-08-23

    Hello, My browser will redirect to some ad (changes each time) during normal browsing. I've tried running malwarebytes and superantispyware but still happening. Using google chrome as browser Tech Support Guy System Info Utility version OS Ve

  • Toggle visibility of div tags based on Browser Language 2009-05-13

    First off, I'm a PM and the dev team is already mad at me. So I'd like to take a shot creating the solution to the question below. We have a static maintenance mode html page that displays "Please check back soon" in 24 languages. Right now we are di

  • JavaScript for detecting browser language preference 2009-06-25

    I have been trying to detect the browser language preference using JavaScript. If I set the browser language in IE in Tools>Internet Options>General>Languages, how do I read this value using JavaScript? Same problem for Firefox. I'm not able

  • What is a good solution for cross browser javascript redirect with history? 2009-07-23

    I am currently fighting Google Chrome on the following action: location.href = url location.replace(url) document.location = url window.navigate(url) // doesn't work in Chrome/Firefox location.assign(url), '_self') window.location.hre

  • Detecting the browser language of choice with PHP 2009-11-19

    I'm trying to implement this code to have different files to load for german, spanish or english browser languages of choice. The case is that with my spanish IE I still get the english file. <?php if (is_home()) { if (preg_match('/de-DE/i', $_SER

  • Determine browser language(s) in Zend Framework? 2010-03-06

    I am dissolving a rather big old library with various PHP helper functions that have amassed over time. I'm looking for Zend Framework based replacements for as many of these functions as possible. My first candidate is a function that returns the us

  • How do I change the browser language with Javascript 2010-09-20

    I want to access the user browser settings and change the browser language, is this possible using Javascript? If it's possible, how can I access this? (sample code please) --------------Solutions------------- No that is not possible. How would you f

Copyright (C), All Rights Reserved.

processed in 0.465 (s). 13 q(s)