Answers.Body: <p>Make sure to remove Craft’s default rewrite rule (“Send would-be 404 requests to Craft”) from the .htaccess in your document root, so it’s only in the .htaccess files of your locales’ subfolders. You can now remove the index.php as well and requests to your homepage domain.com/ should now respond with a 404 HTTP error.</p>
  
  <p>You have now removed all (duplicate) routes starting at root level.</p>
  
  <p>Last step is to redirect visits to the homepage to en/ via the .htaccess in your document root.</p>
  
  <pre><code>RewriteEngine On
  RewriteRule ^$ /en [R=301,L]
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-14T20:42:51.643Z
Answers.Text: Perfect, thank you.
Answers.UserDisplayName: CreateSean
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-14T16:37:00.553Z
Answers.LastActivityDate: 2017-11-14T16:42:04.540Z
Answers.LastEditDate: 2017-11-14T16:42:04.540Z
Answers.UserDisplayName: carlcs
Body: <p>I'm setting up a multi-lingual site and want to force the language segments:</p>
  
  <p>domain.com/en/<br>
  domain.com/fr/</p>
  
  <p>However if you go in the URL bar and remove the en/ or fr/ it loads up the English page without the language segment. How do I force this to load. Have tried a few .htaccess suggestions found via Google but nothing is working.</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-11-14T13:32:22.977Z
Comments.Text: Just wondering if you ever got a solution for this one? If so I'd be interested to hear what it is. Thanks! Andrew
Comments.UserDisplayName: Andrew Macpherson
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-11-14T13:51:09.160Z
Comments.Text: Not yet, and not sure what to do.
Comments.UserDisplayName: CreateSean
Tags: <localization><htaccess>
Title: Force language segment in URL on multi-lingual site
ThreadText: # Force language segment in URL on multi-lingual site
  
  (Asked by: username_0 on 2017-11-09)
  
  I'm setting up a multi-lingual site and want to force the language segments:
  
  domain.com/en/  
  domain.com/fr/
  
  However if you go in the URL bar and remove the en/ or fr/ it loads up the English page without the language segment. How do I force this to load. Have tried a few .htaccess suggestions found via Google but nothing is working.
  
  **Tags:** localization, htaccess
  
  > **Comments:**
  > **username_1**: Just wondering if you ever got a solution for this one? If so I'd be interested to hear what it is. Thanks! username_1  
  > **username_0**: Not yet, and not sure what to do.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2017-11-14. Score: 2
  
  Make sure to remove Craft’s default rewrite rule (“Send would-be 404 requests to Craft”) from the .htaccess in your document root, so it’s only in the .htaccess files of your locales’ subfolders. You can now remove the index.php as well and requests to your homepage domain.com/ should now respond with a 404 HTTP error.
  
  You have now removed all (duplicate) routes starting at root level.
  
  Last step is to redirect visits to the homepage to en/ via the .htaccess in your document root.
  
  ```
  RewriteEngine On
  RewriteRule ^$ /en [R=301,L]
  
  ```
  
  > **Comments:**
  > **username_0**: Perfect, thank you.  
  
  ---
  
  