2

I followed the Craft directions for setting up a localized site. In the fifth step I followed the first example for setting up my folder structure. In my case the languages I'm working with are French and Arabic.

craft/
public_html/
   fr/                 --> example.com/fr/ (french)
      .htaccess
      index.php
   ar/                 --> example.com/ar/ (arabic)
      .htaccess
      index.php

The primary language for the site is French, what is the best way to redirect so that if a visitor comes to the root of the site www.example.com they will be redirected to the French version at www.example.com/fr/ ?

Should I use a .htaccess file in main public_html directory of the site, should I use the dynamic routes in Craft, or is there some other, better, way?

3

I would put a .htaccess file in the public HTML folder and let Apache deal with it, that way you don't have the overhead of PHP/Craft having to deal with that request.

0
2

Here's the setup I used for the .htaccess file if anyone is interested:

RewriteEngine on
RewriteCond %{REQUEST_URI} ^/$
RewriteRule (.*) http://example.com/new_directory/ [R=301,L]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.