Hi Guys,
I’ve been struggling with this mod_rewrite thing for a while now, so it was time I threw it into the (awesome) group.
I have a site where some of the sections (pages) are accessed through subdomains (for example: blog.domain.com, news.domain.com, etc..) and also just the normal domain (domain.com). All the subdomains need to point to a template_group and I’ve almost got it working.
This is the .htaccess I’ve got so far:
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_HOST} ^(blog|news).domain.com$ [NC]
RewriteCond %{REQUEST_FILENAME} !(blog|news)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ %1/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]Like I said… it almost works, except for this one little problem. When I access an url like blog.domain.com/entry/ee-is-awesome it works as expected and loads the blog/entry template. But when I go to blog.domain.com it just shows me the same template as domain.com instead of loading blog/index. Even if I add some jibberish at the end (blog.domain.com/sdffds) it works and I get the blog/index template…
Who here has enough mod_rewrite chops to help me out on this one, because I’m stumped.
Regards,
Wouter