homepage Welcome to WebmasterWorld Guest from 54.205.254.108
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
Having multiple htaccess for a multisite CMS
Cirilo007




msg:3908102
 5:42 pm on May 6, 2009 (gmt 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 !

 

jdMorgan




msg:3908642
 2:24 pm on May 7, 2009 (gmt 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].

Jim

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved