开发者

How do I exclude one directory from mod_rewrite rules?

I need to install Expression Engine on a subdomain for a client, and he is already running a php-based program on the main domain. Whoever set up the database program on the main domain apparently needs all .php extensions removed, but this makes it so that I can't even run the install for Expression Engine because of the rewrites in the htaccess file. I'm afraid to make changes to the htaccess file, obviously, for fear of screwing up the root domain's program开发者_如何学Python - how can I change this so that the subdomain directory that I am working in does not have these rules applied, and not affect any of the current settings on the root domain?

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d [OR]
# This ensures that Apache will not mistake the URL mysite.com/archive/ for a request for the physical directory that stores files
RewriteCond %{REQUEST_URI}  .+\/archive\/
RewriteRule !\.(js|ico|gif|jpg|png|css)$ index.php


You could add a condition to exclude URLs to that directory like:

RewriteCond %{REQUEST_URI} !^/foobar/
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜