File: //proc/thread-self/root/home/eatingdisordersadvice.co.uk/public_html/nginx.txt
# Redirect non-www to www
# Add a trailing slash (/) to a URL
rewrite ^([^.]*[^/])$ $1/ permanent;
# Specific redirections
if ($args ~* ^pfstyle=wp$){ rewrite ^/2011/09/16/10-warning-signs-that-a-young-person-might-have-anorexia/?$ /2011/09/16/10-warning-signs-that-a-young-person-might-have-anorexia/pfstyle-wp/? permanent; }
if ($args ~* ^pfstyle=wp$){ rewrite ^/2011/09/16/5-warning-signs-that-a-young-person-might-have-bulimia/?$ /2011/09/16/5-warning-signs-that-a-young-person-might-have-bulimia/pfstyle-wp/? permanent; }
if ($args ~* ^pfstyle=wp$){ rewrite ^/2011/09/16/family-factors-that-might-put-a-young-person-at-risk-of-developing-an-eating-disorder/?$ /2011/09/16/family-factors-that-might-put-a-young-person-at-risk-of-developing-an-eating-disorder/pfstyle-wp/? permanent; }
if ($args ~* ^pfstyle=wp$){ rewrite ^/2011/09/16/personality-factors-that-might-put-a-young-person-at-risk-of-developing-an-eating-disorder/?$ /2011/09/16/personality-factors-that-might-put-a-young-person-at-risk-of-developing-an-eating-disorder/pfstyle-wp/? permanent; }
if ($args ~* ^pfstyle=wp$){ rewrite ^/2011/09/16/physical-warning-signs-that-a-young-person-might-have-an-eating-disorder/?$ /2011/09/16/physical-warning-signs-that-a-young-person-might-have-an-eating-disorder/pfstyle-wp/? permanent; }
if ($args ~* ^pfstyle=wp$){ rewrite ^/2011/09/16/social-factors-that-might-put-a-young-person-at-risk-of-developing-an-eating-disorder/?$ /2011/09/16/social-factors-that-might-put-a-young-person-at-risk-of-developing-an-eating-disorder/pfstyle-wp/? permanent; }
if ($args ~* ^pfstyle=wp$){ rewrite ^/2011/09/16/what-is-an-eating-disorder/?$ /2011/09/16/what-is-an-eating-disorder/pfstyle-wp/? permanent; }
if ($args ~* ^pfstyle=wp$){ rewrite ^/2011/09/16/what-is-anorexia/?$ /2011/09/16/what-is-anorexia/pfstyle-wp/? permanent; }
if ($args ~* ^pfstyle=wp$){ rewrite ^/2011/09/16/what-is-binge-eating-disorder/?$ /2011/09/16/what-is-binge-eating-disorder/pfstyle-wp/? permanent; }
if ($args ~* ^pfstyle=wp$){ rewrite ^/2011/09/16/what-is-bulimia/?$ /2011/09/16/what-is-bulimia/pfstyle-wp/? permanent; }
if ($args ~* ^pfstyle=wp$){ rewrite ^/2011/09/24/guidelines-eating-disorder-confide/?$ /2011/09/24/guidelines-eating-disorder-confide/pfstyle-wp/? permanent; }
if ($args ~* ^pfstyle=wp$){ rewrite ^/2011/09/27/why-do-people-suffer-from-eating-disorders/?$ /2011/09/27/why-do-people-suffer-from-eating-disorders/pfstyle-wp/? permanent; }
if ($args ~* ^pfstyle=wp$){ rewrite ^/2011/10/14/how-and-why-you-should-alter-your-academic-expectations-for-eating-disorders-sufferers/?$ /2011/10/14/how-and-why-you-should-alter-your-academic-expectations-for-eating-disorders-sufferers/pfstyle-wp/? permanent; }
if ($args ~* ^pfstyle=wp$){ rewrite ^/2011/10/24/eating-disorders-policy-for-use-in-your-school/?$ /2011/10/24/eating-disorders-policy-for-use-in-your-school/pfstyle-wp/? permanent; }
if ($args ~* ^pfstyle=wp$){ rewrite ^/2011/10/28/12-tips-for-writing-an-eating-disorders-policy-for-your-school/?$ /2011/10/28/12-tips-for-writing-an-eating-disorders-policy-for-your-school/pfstyle-wp/? permanent; }
if ($args ~* ^pfstyle=wp$){ rewrite ^/2011/11/15/bullying-can-trigger-and-fuel-eating-disorders-its-time-to-take-it-seriously/?$ /2011/11/15/bullying-can-trigger-and-fuel-eating-disorders-its-time-to-take-it-seriously/pfstyle-wp/? permanent; }
if ($args ~* ^pfstyle=wp$){ rewrite ^/2011/11/22/worried-about-a-pupil-when-should-you-say-something/?$ /2011/11/22/worried-about-a-pupil-when-should-you-say-something/pfstyle-wp/? permanent; }
if ($args ~* ^pfstyle=wp$){ rewrite ^/2011/11/29/book-review-a-girl-called-tim-by-june-alexander/?$ /2011/11/29/book-review-a-girl-called-tim-by-june-alexander/pfstyle-wp/? permanent; }
if ($args ~* ^pfstyle=wp$){ rewrite ^/2011/12/01/how-can-we-best-work-with-parents-to-support-pupils-with-eating-disorders/?$ /2011/12/01/how-can-we-best-work-with-parents-to-support-pupils-with-eating-disorders/pfstyle-wp/? permanent; }
if ($args ~* ^pfstyle=wp$){ rewrite ^/2012/01/10/eating-disorders-dispelling-some-urban-myths/?$ /2012/01/10/eating-disorders-dispelling-some-urban-myths/pfstyle-wp/? permanent; }
if ($args ~* ^pfstyle=wp$){ rewrite ^/2012/01/16/whats-the-difference-between-a-diet-and-an-eating-disorder/?$ /2012/01/16/whats-the-difference-between-a-diet-and-an-eating-disorder/pfstyle-wp/? permanent; }
if ($args ~* ^pfstyle=wp$){ rewrite ^/2012/01/31/binge-eaters-not-just-fat-but-hurting-inside-and-in-need-of-support/?$ /2012/01/31/binge-eaters-not-just-fat-but-hurting-inside-and-in-need-of-support/pfstyle-wp/? permanent; }
if ($args ~* ^pfstyle=wp$){ rewrite ^/2012/02/07/what-can-teachers-do-to-help-pupils-with-eating-disorders/?$ /2012/02/07/what-can-teachers-do-to-help-pupils-with-eating-disorders/pfstyle-wp/? permanent; }
if ($args ~* ^pfstyle=wp$){ rewrite ^/2012/02/23/break-the-silence-beat-eating-disorders/?$ /2012/02/23/break-the-silence-beat-eating-disorders/pfstyle-wp/? permanent; }
if ($args ~* ^pfstyle=wp$){ rewrite ^/2012/02/25/behavioural-warning-signs-that-a-young-person-might-be-suffering-from-an-eating-disorder/?$ /2012/02/25/behavioural-warning-signs-that-a-young-person-might-be-suffering-from-an-eating-disorder/pfstyle-wp/? permanent; }
if ($args ~* ^pfstyle=wp$){ rewrite ^/2012/03/20/edic-2012-presentation/?$ /2012/03/20/edic-2012-presentation/pfstyle-wp/? permanent; }
if ($args ~* ^pfstyle=wp$){ rewrite ^/2012/04/20/10-binge-eating-disorder-warning-signs/?$ /2012/04/20/10-binge-eating-disorder-warning-signs/pfstyle-wp/? permanent; }
if ($args ~* ^pfstyle=wp$){ rewrite ^/2012/04/23/the-importance-of-early-detection-of-eating-disorders/?$ /2012/04/23/the-importance-of-early-detection-of-eating-disorders/pfstyle-wp/? permanent; }
if ($args ~* ^pfstyle=wp$){ rewrite ^/2012/05/08/practical-listening-skills-when-talking-to-someone-with-an-eating-disorder/?$ /2012/05/08/practical-listening-skills-when-talking-to-someone-with-an-eating-disorder/pfstyle-wp/? permanent; }
if ($args ~* ^pfstyle=wp$){ rewrite ^/2012/06/18/anorexia-recovery-isnt-easy-but-it-is-possible/?$ /2012/06/18/anorexia-recovery-isnt-easy-but-it-is-possible/pfstyle-wp/? permanent; }
if ($args ~* ^pfstyle=wp$){ rewrite ^/2012/07/03/5-useful-phrases-when-talking-to-someone-with-an-eating-disorder/?$ /2012/07/03/5-useful-phrases-when-talking-to-someone-with-an-eating-disorder/pfstyle-wp/? permanent; }
if ($args ~* ^pfstyle=wp$){ rewrite ^/2012/07/17/mealtimes-10-ideas-for-supporting-recovering-anorexics/?$ /2012/07/17/mealtimes-10-ideas-for-supporting-recovering-anorexics/pfstyle-wp/? permanent; }
if ($args ~* ^pfstyle=wp$){ rewrite ^/2012/07/23/weight-change-the-ultimate-eating-disorder-warning-sign/?$ /2012/07/23/weight-change-the-ultimate-eating-disorder-warning-sign/pfstyle-wp/? permanent; }
if ($args ~* ^pfstyle=wp$){ rewrite ^/2012/07/26/healthy-weight-loss-can-put-young-people-at-risk-of-anorexia/?$ /2012/07/26/healthy-weight-loss-can-put-young-people-at-risk-of-anorexia/pfstyle-wp/? permanent; }
if ($args ~* ^pfstyle=wp$){ rewrite ^/2012/07/29/overcoming-pupil-objections-to-informing-parents-about-their-eating-disorder/?$ /2012/07/29/overcoming-pupil-objections-to-informing-parents-about-their-eating-disorder/pfstyle-wp/? permanent; }
if ($args ~* ^pfstyle=wp$){ rewrite ^/2012/08/07/teaching-pupils-about-eating-disorders/?$ /2012/08/07/teaching-pupils-about-eating-disorders/pfstyle-wp/? permanent; }
if ($args ~* ^pfstyle=wp$){ rewrite ^/2012/08/14/tackling-the-eating-disorders-taboo-in-school/?$ /2012/08/14/tackling-the-eating-disorders-taboo-in-school/pfstyle-wp/? permanent; }
if ($args ~* ^pfstyle=wp$){ rewrite ^/2012/08/20/what-not-to-say-to-recovering-anorexics/?$ /2012/08/20/what-not-to-say-to-recovering-anorexics/pfstyle-wp/? permanent; }
if ($args ~* ^pfstyle=wp$){ rewrite ^/2012/08/22/talking-to-parents-about-eating-disorders-on-the-phone/?$ /2012/08/22/talking-to-parents-about-eating-disorders-on-the-phone/pfstyle-wp/? permanent; }
if ($args ~* ^pfstyle=wp$){ rewrite ^/2012/08/30/eating-disorders-recovery-how-to-handle-a-rough-patch/?$ /2012/08/30/eating-disorders-recovery-how-to-handle-a-rough-patch/pfstyle-wp/? permanent; }
if ($args ~* ^pfstyle=wp$){ rewrite ^/2012/09/27/involving-parents-in-their-childs-eating-disorder-recovery/?$ /2012/09/27/involving-parents-in-their-childs-eating-disorder-recovery/pfstyle-wp/? permanent; }
if ($args ~* ^pfstyle=wp$){ rewrite ^/2012/10/05/anorexia-warning-signs-presentation/?$ /2012/10/05/anorexia-warning-signs-presentation/pfstyle-wp/? permanent; }
if ($args ~* ^pfstyle=wp$){ rewrite ^/2012/10/09/safe-participation-in-school-sports-for-young-people-recovering-from-anorexia-nervosa/?$ /2012/10/09/safe-participation-in-school-sports-for-young-people-recovering-from-anorexia-nervosa/pfstyle-wp/? permanent; }
if ($args ~* ^pfstyle=wp$){ rewrite ^/2012/10/16/when-a-pupil-becomes-an-eating-disorders-inpatient/?$ /2012/10/16/when-a-pupil-becomes-an-eating-disorders-inpatient/pfstyle-wp/? permanent; }
if ($args ~* ^pfstyle=wp$){ rewrite ^/2012/10/23/how-to-retain-a-pupils-trust-without-promising-confidentiality/?$ /2012/10/23/how-to-retain-a-pupils-trust-without-promising-confidentiality/pfstyle-wp/? permanent; }
if ($args ~* ^pfstyle=wp$){ rewrite ^/2012/11/09/bulimia-warning-signs-presentation/?$ /2012/11/09/bulimia-warning-signs-presentation/pfstyle-wp/? permanent; }
if ($args ~* ^pfstyle=wp$){ rewrite ^/2012/11/19/overcoming-negative-responses-from-parents/?$ /2012/11/19/overcoming-negative-responses-from-parents/pfstyle-wp/? permanent; }
if ($args ~* ^pfstyle=wp$){ rewrite ^/2012/11/28/what-are-pro-ana-and-pro-mia-sites-and-what-can-we-do-about-them/?$ /2012/11/28/what-are-pro-ana-and-pro-mia-sites-and-what-can-we-do-about-them/pfstyle-wp/? permanent; }
if ($args ~* ^pfstyle=wp$){ rewrite ^/2012/12/17/pro-ana-sites-discussion-on-huff-live/?$ /2012/12/17/pro-ana-sites-discussion-on-huff-live/pfstyle-wp/? permanent; }
if ($args ~* ^pfstyle=wp$){ rewrite ^/2013/02/14/does-advertising-shape-up-the-body-ideal-debate-event/?$ /2013/02/14/does-advertising-shape-up-the-body-ideal-debate-event/pfstyle-wp/? permanent; }
# Create pretty URLs
rewrite ^/([^/]+)/$ /$1.html last;
rewrite ^/([^/]+)/([^/]+)/$ /$1/$2.html last;
rewrite ^/([^/]+)/([^/]+)/([^/]+)/$ /$1/$2/$3.html last;
rewrite ^/([^/]+)/([^/]+)/([^/]+)/([^/]+)/$ /$1/$2/$3/$4.html last;
rewrite ^/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/$ /$1/$2/$3/$4/$5.html last;
rewrite ^/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/$ /$1/$2/$3/$4/$5/$6.html last;
rewrite ^/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/$ /$1/$2/$3/$4/$5/$6/$7.html last;
rewrite ^/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/$ /$1/$2/$3/$4/$5/$6/$7/$8.html last;
rewrite ^/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/$ /$1/$2/$3/$4/$5/$6/$7/$8/$9.html last;
rewrite ^/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/$ /$1/$2/$3/$4/$5/$6/$7/$8/$9/$10.html last;
# End: Create pretty URLs
# Redirect all extensions to html
if ($is_args = ''){
rewrite ^([^.]*)\.shtml$ $1.html permanent;
rewrite ^([^.]*)\.phtml$ $1.html permanent;
rewrite ^([^.]*)\.jhtml$ $1.html permanent;
rewrite ^([^.]*)\.htm$ $1.html permanent;
rewrite ^([^.]*)\.php$ $1.html permanent;
rewrite ^([^.]*)\.aspx$ $1.html permanent;
rewrite ^([^.]*)\.asp$ $1.html permanent;
rewrite ^([^.]*)\.jsp$ $1.html permanent;
rewrite ^([^.]*)\.apk$ $1.html permanent;
}
# End: Redirect all extensions to html