Friday, August 26, 2011

Re: third level domain and cakephp

Something like this might work for you, if you replace the lines you posted with this slightly longer version:

RewriteCond %{REMOTE_HOST} = test.domain.com
RewriteRule ^$ app/webroot/test/ [L]

RewriteCond %{REMOTE_HOST} = test.domain.com
RewriteRule (.*) app/webroot/test/$1 [L] 

RewriteRule ^$ app/webroot/ [L]
RewriteRule (.*) app/webroot/$1 [L]  

There might be a way to do it with less rewrite conditions, and this is untested, but I don't see why it wouldn't work...

You could also duplicate the first two blocks of code and change the REMOTE_HOST value to support any other subdomains you need to work like this.

The important thing is that those rules are BEFORE the normal CakePHP rewrite rules, and that they have the [L] at the end, or they won't work properly.

Thanks,

Ben

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
 
 
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

No comments: