first question: http://htaccess.net.ru/doc/ErrorDocument/ErrorDocument2.php
<Directory "/"> ErrorDocument 404 /index.php </Directory>
Second
RewriteCond %{HTTP_HOST} ^(www.)?(.*?)\.mydev/$ [NC] RewriteRule ^(.*)$ sub.php?q=$1 [L]
Third
RewriteCond %{HTTP_HOST} ^(www.)?(.*?)\.mydev/admin/$ [NC] RewriteRule ^(.*)$ index.php?q=$1 [L]
And the general view should be as follows:
# 1 <Directory "/"> ErrorDocument 404 /index.php </Directory> # 3 RewriteCond %{HTTP_HOST} ^(www.)?(.*?)\.mydev/admin/$ [NC] RewriteRule ^(.*)$ index.php?q=$1 [L] # 2 RewriteCond %{HTTP_HOST} ^(www.)?(.*?)\.mydev/$ [NC] RewriteRule ^(.*)$ sub.php?q=$1 [L]
It seems to be all right