title: Configure .htaccess for subdomain
body: <p>I have a example.com and i created a subdomain for it in Cpanel. In Cpanel it appears: </p>
  
  <p><strong>test.domain.com    /public_html/test  not redirected</strong>
  I want to access my new subdomain: test.domain.com I have created an index.html in the subdomain folder: /home/domainname/public_html/test</p>
  
  <p>My .htaccess is:</p>
  
  <pre><code> AddType text/x-component .htc
   RewriteEngine on     
   RewriteCond %{HTTPS} off     
   RewriteRule ^(.*)$ https://example.com/$1 [L,R=301]
   RedirectMatch 301 ^/test/(.*)$ http://test.example.com/$1
   RewriteRule ^(en|fr)/([a-z]*) /index.php
   RewriteRule !\.
   (js|ico|gif|jpg|jpeg|png|css|swf|htm|xml|php|map|ttf|woff|woff2)$ 
    index.php
   RewriteRule ^(form|ajax|captcha)/([a-z]*) /index.php
  </code></pre>
  
  <p>The domain.com have ssl and for subdomain i don`t. I added this line in .htaccess for subdomain:</p>
  
  <pre><code>RedirectMatch 301 ^/test/(.*)$ http://test.example.com/$1
  </code></pre>
  
  <p>But not working: when accessing the test.example.com i get <strong>"This page isn’t working test.example.com redirected you too many times."</strong></p>
  
  <p>and if using with https:</p>
  
  <pre><code>RedirectMatch 301 ^/test/(.*)$ https://test.example.com/$1
  </code></pre>
  
  <p>I get of course a ssl warning and <strong>Not Found
  The requested URL /home/domainname/public_html/index.php was not found on this server.</strong></p>
  
  <p>What i have done wrong?</p>