Welcome to WebmasterWorld Guest from

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Having multiple htaccess for a multisite CMS

5:42 pm on May 6, 2009 (gmt 0)

New User

10+ Year Member

joined:June 1, 2004
votes: 0

Hi guys,

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.

Thanks in advance !

2:24 pm on May 7, 2009 (gmt 0)

Senior Member

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Mar 31, 2002
votes: 0

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].



Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members