They seem to interfere with eachother, the non-www to www redirect overwrites the subdomain to subdir redirect so subdomains just go to
www.mydomain.com without subdir.
Let me explain the situation, i have subdomains i want to their respective subdir.
So
title.mydomain.com to
www.mydomain.com/title/
titletwo.mydomain.com to
www.mydomain.com/titletwo/
etc.
But right now i also have the non-www to www redirect code:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^mydomain\.com$ [NC]
RewriteRule ^(.*)$ http://www.mydomain.com/$1 [R=301,L]
But when i add this subdomain to subdir code to the htaccess (which redirects all subdomains to subdirs except when it's www):
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteCond %{HTTP_HOST} ^(.*)\.mydomain\.com [NC]
RewriteRule (.*) http://www.mydomain.com/%1/$1 [R=301,L]
.... it just redirects the subdomains to the home page
www.mydomain.com.
How do i do this?