You need to configure .htaccess as follows: When accessing http: // mydev /, all requests to non-existent files were redirected to index.php

When accessing any subdomain http: // (. *) .Mydev / redirect occurred to sub.php

With http: // (. *). Mydev / admin / again to index.php

I do not know how to solve it, help please

    1 answer 1

    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