title: Why is my subdomain redirecting to my main domain?
body: <p>So basically, I have a subdomain, <code>m.mydomain.com.au</code> although every time I visit it, I am redirected to <code>www.mydomain.com.au/m</code>.</p>
  
  <p>For example, if I attempt to go to <code>m.mydomain.com.au/contact.php</code>, I am automatically redirected to <code>www.mydomain.com.au/m/contact.php</code></p>
  
  <p>I have never attempted to modify my <code>.htaccess</code> file before, but I believe it is causing the problem at the moment.</p>
  
  <p>All help and suggestions is greatly appreciated.</p>
  
  <p>Here is my full <code>.htaccess</code> file:</p>
  
  <pre><code>Options +FollowSymLinks
  
  # Use Mod_deflate to compress static files
  &lt;ifmodule mod_deflate.c&gt;
  &lt;filesmatch ".(js|css|ico|txt|htm|html|php)$"&gt;
  SetOutputFilter DEFLATE
  &lt;/filesmatch&gt;
  &lt;/ifmodule&gt;
  
  # Speed up caching
  FileETag MTime Size
  
  # Expires
  ExpiresActive On
  ExpiresDefault "access plus 366 days"
  
  # Future Expires Headers
  &lt;filesmatch ".(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$"&gt;
  Header set Expires "Sat, 27 Dec 2014 23:59:59 GMT"
  &lt;/filesmatch&gt;
  
  
  RewriteEngine On
  
  
  RewriteCond %{QUERY_STRING} base64_encode[^(]*\([^)]*\) [OR]
  RewriteCond %{QUERY_STRING} (&lt;|%3C)([^s]*s)+cript.*(&gt;|%3E) [NC,OR]
  RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
  RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
  RewriteRule .* index.php [F]
  RewriteCond %{HTTP_HOST} !^www\.mydomain\.com\.au
  RewriteRule ^(.*)$ http://www.mydomain.com.au/$1 [R=permanent,L]
  
  #RewriteBase /
  
  
  RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
  
  RewriteCond %{REQUEST_URI} !^/index\.php
  
  RewriteCond %{REQUEST_URI} /component/|(/[^.]*|\.(php|html?|feed|pdf|vcf|raw))$ [NC]
  
  RewriteCond %{REQUEST_FILENAME} !-f
  
  RewriteCond %{REQUEST_FILENAME} !-d
  
  RewriteRule .* index.php [L]
  </code></pre>