html - how do i use .htaccess to redirect different languages to different pages? -


i'm trying make simple 2-language site, en , th, unfamiliar .htaccess found online tool: http://www.htaccesstools.com/redirection-by-language/

i english browsers go root folder's index.html, , thai browsers subfolder.

what got generator is:

rewriteengine on rewritecond %{http:accept-language} th [nc] rewriterule .* http://www.mysite.com/th/index.html [r,l] 

this doesn't work , redirect loop/other error. i've tried changing url on last line relative, doesn't affect it.

any help?

*to confirm, have 1 .htaccess in root folder only

try in .htaccess file:

options +followsymlinks -multiviews rewriteengine on rewritecond %{request_uri} !^(/th/index.html|.*\.(woff|ttf|svg|js|ico|gif|jpg|png|css|htc|xml|txt))$ [nc] rewritecond %{http:accept-language} ^th [nc] rewriterule .* /th/index.html [r,l,qsa,ne] 

Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -