I'm developing a multisite CMS and I'm facing a new challenge because now I want each websites to have their own htaccess file with their own rules etc... while keeping one general htaccess file with default rules(like non-www vs www etc..). This is mainly to avoid dealing with 1 huge htaccess file and avoid problems to all the websites running on this CMS if there is one piece of code messing for a website.
I've read that could be achieved with the virtualhost and the AccessFileName, but unfortunatly since I'm on a reseller hosting, I don't have access to the VH settings.
Can this be done differently ? I'd like to have 1 htaccess file per domain pointing to the web root of my CMS. Any ideas would be greatly appreciated.
The easiest solution in my limited experience is to get an account with a unique IP address - an "IP-based virtual server"), typically available in the U.S. for about $1.00 more per month over a name-based virtual hosting account.
This allows you to point as many domains and subdomains as you like at your server's IP address, and then use an .htaccess file in the top-level Web-accessible directory to 'sort out' all these domains and subdomains and point each of them to their own filespace. Within that separate filespace, you can have additional per-directory .htaccess files, and it will be possible for each 'site' to access shared code or objects in the top-level directory or other subdirectories of that top-level directory.
If you use a name-based virtual host, then you must explicitly declare/define each added domain and/or subdomain one-at-a-time in your "Control Panel," and sharing resources among them becomes problematic, as also recently discussed.
I just presented a simple example for subdomains in this thread [webmasterworld.com].