How do you add subdirectories localization to your website? -
Mr.Anonymous - 06.01.2019
Hi guys, I'm still learning stuff and need some help. How do you add subdirectories localization to your website? Some websites uses subdirectories for languages for example
www.website.com/en/ or
www.website.com/fr/. I'm currently using URL parameters for my website which would be
www.website.com?lang=en and based on that I fetch data from my database. But I guess just
www.website.com/en/ looks way better. So how do it do it? My website is not static so I cannot just create actual subdirectories plus I have over 40 languages/translated data in my database. Any help would be appreciated.
Re: How do you add subdirectories localization to your website? -
ozm8ey - 07.01.2019
idk if i understand your question correctly but i think you may be looking for clean/friendly urls. For me you just need to edit the apache config and set the AllowOverride All on the directory
Re: How do you add subdirectories localization to your website? -
X337 - 07.01.2019
use rewrite feature, here is the tutorial for
nginx and
apache
Re: How do you add subdirectories localization to your website? -
BlackyX - 11.01.2019
you could also use subdomains
Re: How do you add subdirectories localization to your website? -
K0P - 11.01.2019
Make new sub folders using FTP, those folders should be named like 'ru' or 'en' etc, they will contain the versions of site in different languages. (Never tried) Check if it works.
Re: How do you add subdirectories localization to your website? -
BlackBank - 11.01.2019
Quote:
Originally Posted by K0P
Make new sub folders using FTP, those folders should be named like 'ru' or 'en' etc, they will contain the versions of site in different languages. (Never tried) Check if it works.
|
Just no.. Just rewrite the url via nginx or apache(htaccess).
Re: How do you add subdirectories localization to your website? -
MinecraftSeeds - 26.02.2019
Use this tool to do exactly what you want
https://www.generateit.net/mod-rewrite/index.php .
Enter in the url you have with the standard query string arguments. It will then give you a form to rewrite that so it looks like a subdirectory. It will give you the code then to add to your .htaccess file.