Thanks in advance, everyone; this one's a doozy.
I've been tasked with porting a subdomain, that was previously hosted on its own server, into an existing ExpressionEngine installation.
Previously, the site in question was at franchise.domain.com - now that data (or at least the ExpressionEngine Groups/Templates) resides at www.domain.com/franchise .
The question: given my lack of access to httpd (which I presume might be helpful), and given my access to an .htaccess file, how do I point franchise.domain.com to www.domain.com/franchise, in a fashion that's transparent to the end-user?
An additional wrinkle: That same .htaccess file is also being used to hide the /index.php/ that ExpressionEngine requires in order to do its nutty database procedures.
In other words, here's what I need:
The user sees: franchise.domain.com/whatever The server sees: www.domain.com/index.php/franchise/whatever
I've been working at this myself for the last couple days, pouring through Google and the EE Docs, Forums, and Wiki, and unfortunately this is an extremely time-sensitive project - our long-term revenue comes from the sale of our franchises.
Can anyone help?
Relevant lines from .htaccess as follows:
#Temporarily redirect franchise.domain.com to domain.com/franchise,
#just so we have SOMETHING up
RewriteEngine On
RewriteCond %{HTTP_HOST} franchise.domain.com
RewriteRule ^(.*)$ http://www.domain.com/franchise/$1 [R,L]
#Rewrites domain.com to http://www.domain.com, may be interfering
#with my attempts, but I'm not sure.
RewriteCond %{HTTP_HOST} ^domain\.com [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L]
#Removes /index.php/ from EE urls
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]
Unfortunately, I've been unable to make that first set of directives transparent to the end-user... my understanding is that it involves a certain amount of voodoo which is way over my head. (Something about adding a hash or marker, to stop Apache from redirecting infinitely).
Thanks again, everyone.