Search code examples
php.htaccessexpressionengine

Entries as Subdomains in ExpressionEngine


I'm trying to setup some rules for ExpressionEngine that will automatically make an entry accessible (and display) like a subdomain. The standard URL path for an ExpressionEngine entry would be:

http://mysite.com/post/entry.title

But I need it to be accessible and appear as:

http://entry.title.mysite.com

This only has to be for one particular channel and using one specific template group/template. It does have to be dynamic though, so that whenever a new entry is created, it can automatically be accessible at http://entry.title.mysite.com. I understand that this might be possible through a wildcard in .htacess but I'm not sure how to do this.


Solution

  • Search the Qs here for HTTP_HOST. Lots of examples which answer this generic Q :-) Note that how it works depends on how your hosting provider has configured the use of subdomains. Some always use the DOCROOT for all subdomains, some provide an admin panel to map them to subdirectories. You will need to find out which your host does from its FAQs.