Site icon Hip-Hop Website Design and Development

What to put in writing within the htaccess with a view to detect browser language and level accordingly?

On quick:
I take advantage of Polylang plugin for my net however it’s choice to detect browser language will not work as a result of I want to make use of cache in the entire web site, together with the homepage.

I’ve a bilingual web site (english and spanish) which handles numerous Customized Publish Sort and Customized Fields knowledge. Because of this I MUST use cache and CDN (like Cloudflare) with a view to obtain good pace and efficiency by serving static recordsdata.

This isn’t my area of experience so I do know little about these things. However, from what I’ve learn, it looks as if creating rewrite guidelines could be a great way so as to add language detection on front-page and present the person the perfect match.

Somebody talked about the next code as an answer for the issue
https://github.com/polylang/polylang/points/450#issuecomment-586484873

# BEGIN Language Redirect

RewriteCond %{HTTP:Settle for-Language} (en|es) [NC]
RewriteRule ^$ https://%{HTTP_HOST}/%1/ [L,R=302]

RewriteRule ^$ https://%{HTTP_HOST}/en/ [L,R=302]

# END Language Redirect

Edit: changed "http" for "https" as identified by @MrWhite

However it did not work for me. Possibly I am writting the .htaccess file between the mistaken strains or possibly these redirects battle with my SSL redirects.

Data that is perhaps related to assist me:
· My internet hosting supplier is Bluehost, i am fairly shure server runs on apache
· I’ve SLL certificates and have ReallySimpleSSL plugin put in on my WordPress
· The subdirectories for mydomain.com/en and mydomain.com/es does not truly exist, Plainly Polylang plugin is just modifying the URLs to make it seem like

Is that this the appropriate approach to do level a person based on it is browser language, from a cached web site?