I am working on a site making my subdir to appear as root just like //domain.com/ is //domain.com/subdir and also access/load files hiding the subdir. My site have this .htaccess(below) and its working. My problem is when I add a subdomain like //admin.domain.com which is //domain.com/subdir/admin my .htaccess redirect me to the main domain //domain.com
Options -Indexes
RewriteEngine on
Options +FollowSymLinks
Options +SymLinksIfOwnerMatch
Options +SymLinksIfOwnerMatch
RewriteCond %{HTTP_HOST} !^domain\.com$ [NC]
RewriteRule .* http://domain.com/ [L,R=301]
RewriteRule ^$ domain/index.php [L]
RewriteCond %{DOCUMENT_ROOT}/domain%{REQUEST_URI} -f
RewriteRule .* domain/$0 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* domain/index.php?rp=$0 [QSA]