# How Evil is If?

**URL:** <https://www.ruby-forum.com/t/how-evil-is-if/220035>\
**Category:** NGINX\
**Created:** [May 25, 2012, 7:52am UTC](https://www.ruby-forum.com/t/how-evil-is-if/220035 "2012-05-25T07:52:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gurdipe\_D](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/b77776/32.png) [@Gurdipe\_D](https://www.ruby-forum.com/u/Gurdipe_D)\
**Post date:** [May 25, 2012, 7:52am UTC](https://www.ruby-forum.com/t/how-evil-is-if/220035/1 "2012-05-25T07:52:35Z")

</div>

In my wordpress Multisite config, I have the below lines. I’ve read  
if-is-evil and so I’m curious if these ifs need to be replaced and with  
what?

* * *

# For multisite: Use a caching plugin/script that creates symlinks to

the correct subdirectory structure to get some performance gains.  
set $cachetest  
“$document\_root/wp-content/cache/ms-filemap/${host}${uri}”;  
if ($uri ~ /$) {  
set $cachetest “”;  
}  
if (-f $cachetest) {  
# Rewrites the URI and stops rewrite processing so it doesn’t  
start over and attempt to pass it to the next rule.  
rewrite ^ /wp-content/cache/ms-filemap/${host}${uri} break;  
}

if ($uri !~ wp-content/plugins) {  
rewrite /files/(.+)$ /wp-includes/ms-files.php?file=$1 last;  
}

# Uncomment one of the lines below for the appropriate caching plugin

(if used).

# include global/wordpress-ms-subdir-wp-super-cache.conf;

# include global/wordpress-ms-subdir-w3-total-cache.conf;

# Rewrite multisite ‘…/wp-._’ and '…/_.php’.

if (!-e $request\_filename) {  
rewrite ^/[\_0-9a-zA-Z-]+(/wp-._) $1 last;  
rewrite ^/[\_0-9a-zA-Z-]+(/._.php)$ $1 last;  
}

* * *

Posted at Nginx Forum:

> **[How Evil is If?](https://forum.nginx.org/read.php?2,226819,226819#msg-226819)**
>
> In my wordpress Multisite config, I have the below lines. I've read if-is-evil and so I'm curious if these ifs need to be replaced and with what? --- # For multisite: Use a caching plugin/script that creates symlinks to the correct subdirectory...

---

<div class="post-metadata">

**Author:** ![CheezItMan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/dbc845/32.png) [@CheezItMan](https://www.ruby-forum.com/u/CheezItMan)\
**Post date:** [May 25, 2012, 5:54pm UTC](https://www.ruby-forum.com/t/how-evil-is-if/220035/2 "2012-05-25T17:54:07Z")

</div>

You have well-documented pages about that.  
[GitHub - nginxinc/nginx-wiki: ARCHIVED -- Source for the now archived NGINX Wiki section of https://www.nginx.com · GitHub](http://wiki.nginx.org/IfIsEvil) (which also expalins why ‘if’ is evil)  
[GitHub - nginxinc/nginx-wiki: ARCHIVED -- Source for the now archived NGINX Wiki section of https://www.nginx.com · GitHub](http://wiki.nginx.org/Pitfalls)

## Are you trying to make the community do your part of the job? ;o)

_B. R._
