# Redirect non-www to www

# Specific redirections
if ($args ~* ^author=5cdb5a5781fde200019ba932$){ rewrite ^/blog$ /blog_author-5cdb5a5781fde200019ba932? permanent; }
rewrite ^/blog/tag/disastasis\+recti$ /blog/tag/disastasis-recti? permanent;
rewrite ^/blog/tag/pregnancy\+chiropractor$ /blog/tag/pregnancy-chiropractor? permanent;
rewrite ^/blog/tag/san\+antonio\+chiropractor$ /blog/tag/san-antonio-chiropractor? permanent;
rewrite ^/blog/tag/postpartum\+chiropractor$ /blog/tag/postpartum-chiropractor? permanent;
rewrite ^/blog/tag/new\+mom$ /blog/tag/new-mom? permanent;
rewrite ^/blog/tag/prenatal\+chiropractor$ /blog/tag/prenatal-chiropractor? permanent;
rewrite ^/blog/tag/san\+antonio$ /blog/tag/san-antonio? permanent;
rewrite ^/blog/tag/breech\+baby$ /blog/tag/breech-baby? permanent;
rewrite ^/blog/tag/webster\+certified$ /blog/tag/webster-certified? permanent;
rewrite ^/blog/tag/webster\+technique$ /blog/tag/webster-technique? permanent;
rewrite ^/blog/tag/round\+ligament$ /blog/tag/round-ligament? permanent;
rewrite ^/blog/tag/low\+back$ /blog/tag/low-back? permanent;
rewrite ^/blog/tag/fetal\+position$ /blog/tag/fetal-position? permanent;
rewrite ^/blog/tag/low\+back\+pain$ /blog/tag/low-back-pain? permanent;
rewrite ^/blog/tag/prenatal\+yoga$ /blog/tag/prenatal-yoga? permanent;
rewrite ^/blog/tag/social\+distancing$ /blog/tag/social-distancing? permanent;
rewrite ^/blog/tag/covid\+19$ /blog/tag/covid-19? permanent;
rewrite ^/blog/tag/neck\+pain$ /blog/tag/neck-pain? permanent;
rewrite ^/blog/tag/back\+pain$ /blog/tag/back-pain? permanent;
rewrite ^/blog/tag/house\+calls$ /blog/tag/house-calls? permanent;
rewrite ^/blog/tag/natural\+health$ /blog/tag/natural-health? permanent;
if ($args ~* ^offset=1582126604496$){ rewrite ^/blog$ /blog_offset-1582126604496? 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
