title: how to create subdomain by .htaccess on rewrite directory
body: <p>I have created a subdomain with this .htaccess; it is working fine on my www.example.com domain but not on www.example.pk. I do not understand where the problem is.</p>
  
  <p><b>www.example.com</b></p>
  
  <pre><code>RewriteCond %{HTTP_HOST} !^www\.example\.com$ [NC]
  RewriteCond %{HTTP_HOST} ^([-a-zA-Z0-9]+)\.example\.com$ [NC]
  RewriteCond %{REQUEST_URI} !^/?index\.php$ 
  RewriteRule ^(.*)/*([0-9]+)*$ index.php?r=list&amp;source=product&amp;product_get=%1&amp;page_page=$1 [NC,QSA,L]
  </code></pre>
  
  <p><b>www.example.pk</b></p>
  
  <pre><code>RewriteCond %{HTTP_HOST} !^www\.example\.pk$ [NC]
  RewriteCond %{HTTP_HOST} ^([-a-zA-Z0-9]+)\.example\.pk$ [NC]
  RewriteCond %{REQUEST_URI} !^/?index\.php$ 
  RewriteRule ^(.*)/*([0-9]+)*$ index.php?r=list&amp;source=product&amp;product_get=%1&amp;page_page=$1 [NC,QSA,L]
  </code></pre>
  
  <p>I created www.example.com domain then the subdomain with cpanel *.example.com. Is it necessary or not? </p>