title: htaccess redirect with www and path
body: <p>I can't get my head around redirects in htaccess. I want that www and the path is always kept.
  For example if I go to <em>example.com/de</em> I want it to redirect to <em><a href="http://www.example.com/en" rel="nofollow noreferrer">www.example.com/en</a></em> but at the moment it always redirects to the root <em>example.com</em> without the subpage.
  Here's what I use currently in the htaccess:</p>
  <pre><code> RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
   RewriteRule ^(.*)$ https://www.example.com/$1 [R=301,L]
  </code></pre>
  <p><strong>UPDATE:</strong>
  I think now I know why it always redirect to root and not the subpage:</p>
  <pre><code># If the file/symlink/directory does not exist =&gt; Redirect to index.php.
  # For httpd.conf, you need to prefix each '%{REQUEST_FILENAME}' with '%{DOCUMENT_ROOT}'.
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME} !-l
  RewriteRule ^.*$ %{ENV:CWD}index.php [QSA,L]
  </code></pre>
  <p>That was a default setting of the CMS I use. I just have no idea how to handle it. If I comment it out the whole page doesn't work.</p>