0

We're slowly introducing sections of our site into EE. First is the blog, then other sections will follow. As a result I need to place EE in the web root, but I also need to leave existing directories alone and allow access.

There are numerous people that touch the files in this web root and I don't want for them to have to add new directory names to the .htaccess file every time they add new directories. People will inevitably forget they have to do this and seek support.

Is there a seamless way to have EE automagically recognize when we need to load static content from a directory vs. a channel entry?

5
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]

Reference

Basically if the request is not a folder or not a file, then add index.php and let EE control it, otherwise it'll be served by whatever is in the relevant path.

Ensure none of your other htaccess entries conflict with this though and that the "other" files in those folders don't try to rewrite back to the EE root.

| improve this answer | |

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.