Hello,
I try to make a change to my current htaccess for now my url looks like> sitename.com/en/filename.ext
I want to get to have an address resembling this:
sitename.com/ca/en/filename.ext (in case the country is Canada and french language)
sitename.com/us/en/filename.ext (in case the country is United State and English language)
sitename.com/eu/en/filename.ext (in case the country is Europe and English language)
sitename.com/en/filename.ext (in case the country is not mentioned and English language)
Here is the current structure of my htaccess
For now I try lots of things, but nothing happens ... if you have an idea, it would be greatly appreciated!
pleasure
I try to make a change to my current htaccess for now my url looks like> sitename.com/en/filename.ext
I want to get to have an address resembling this:
sitename.com/ca/en/filename.ext (in case the country is Canada and french language)
sitename.com/us/en/filename.ext (in case the country is United State and English language)
sitename.com/eu/en/filename.ext (in case the country is Europe and English language)
sitename.com/en/filename.ext (in case the country is not mentioned and English language)
Here is the current structure of my htaccess
Code:
AddDefaultCharset utf-8
SetEnv CA America/Montreal
Options -Indexes +FollowSymlinks
RewriteEngine On
RewriteBase /
<IfModule mod_rewrite.c>
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule \.(?:css|png|jpe?g|gif)$ - [L] #RewriteRule \.(?:css|png|jpe?g|gif|ttf|js)$ - [L]
RewriteRule (fr|en)/(.*) /$2?language=$1 [NC,L,QSA]
#language, detect and set
RewriteCond %{QUERY_STRING} !(?:^|&)language=[^&]+
RewriteCond %{REQUEST_URI} !^/(?:fr|en)/
RewriteCond %{HTTP:Accept-Language} ^fr [NC]
RewriteRule .* /fr/$1 [L,R=permanent]
RewriteCond %{QUERY_STRING} !(?:^|&)language=[^&]+
RewriteCond %{REQUEST_URI} !^/(?:fr|en)/
RewriteRule .* /en/$1 [L,R=permanent]
</IfModule>
For now I try lots of things, but nothing happens ... if you have an idea, it would be greatly appreciated!
pleasure