I have hosting with GoDaddy, and my account supports multiple domains. My directory structure looks like ~/html, and then ~/html/site1, ~/html/site2, etc. In ~/html I have files for my "main" website, then in ~/html/site1 etc, I have files for my other domains.

The root site is a CakePHP site using mod_rewrite for pretty URLs. When I have the rewrite rules in place it breaks site1, site2, and so on. So I need to tweak my .htaccess to ignore those other sites.

Is there a rule I can add which will not apply mod_rewrite and .htaccess to the subfolders containing my other sites?


You could add a RewriteCond using the %{HTTP_HOST} parameter so that the rules will only be used if the host matches the right domain.

RewriteCond %{HTTP_HOST} ^www.domain.tld$

  • Thanks! It took me a while to figure out this RewriteCond condition must precede every rule in my .htaccess file, but I got it working. – the0ther Mar 28 '11 at 3:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.