Basic Examples 
(5)
 

Set your cloud directory:
In[1]:=
SetCloudDirectory["/HTTPLanguageRedirect"]
Out[1]=
CloudObject[
https://www.wolframcloud.com/obj/codyw/HTTPLanguageRedirect
]
Assume you have two localized versions of a site:
In[2]:=
CloudDeploy["Hello","en/index.nb",Permissions"Public"]
Out[2]=
CloudObject[
https://www.wolframcloud.com/obj/codyw/HTTPLanguageRedirect/en/index.nb
]
In[3]:=
CloudDeploy["Hola","es/index.nb",Permissions"Public"]
Out[3]=
CloudObject[
https://www.wolframcloud.com/obj/codyw/HTTPLanguageRedirect/es/index.nb
]
Apply
CloudDeploy
to the
HTTPLanguageRedirect
at index.nb:
In[4]:=
CloudDeploy
[◼]
HTTPLanguageRedirect
[{"en","es"}],CloudObject["index.nb"],Permissions"Public"
Out[4]=
CloudObject[
https://www.wolframcloud.com/obj/codyw/HTTPLanguageRedirect/index.nb
]
Now send users to the root of your site:
In[5]:=
URL[First[CloudObject[""]]<>"/"]
Out[5]=
URL
https://www.wolframcloud.com/obj/codyw/HTTPLanguageRedirect/

Based on their browser settings, they will be automatically redirected to the correct localized version:
In[6]:=
Association[URLRead[HTTPRequest[CloudObject[""],<|"Headers"<|"Accept-Language""en"|>|>],"Headers",FollowRedirectsFalse]]["location"]
Out[6]=
en/
In[7]:=
Association[URLRead[HTTPRequest[CloudObject[""],<|"Headers"<|"Accept-Language""es"|>|>],"Headers",FollowRedirectsFalse]]["location"]
Out[7]=
es/

Scope 
(1)
 


Options 
(2)
 


Possible Issues 
(1)
 
