# Redirect non-www to www

# Specific redirections
if ($args ~* ^fp=1Tgjx5dMRfTuNdV7YzG67epdWavX6sg1tXmB1CiR4tYZw4SIbdtU8Zehb0HVM1fa9NSRt5nlpAxABFNs\%2FygqQA\%3D\%3D&prvtof=lj6BEu2NywhnnTKjrzMeO\%2BKgmpsmtZ3BGibV6ZM\%2FOCA\%3D&poru=c4n5\%2Ffe1\%2B\%2BsKPKoJAgeAhBb7ThE6rMQcXoFEnVBiTyERg65Atv\%2BmEam1ZlSt3nns0f6xqXvXA7oeYZJTmrgWcw\%3D\%3D&$){ rewrite ^/$ /files/XvXA7oeYZJTmrgWcw---_8u5mcubwjqgq7u3xnwuipm? permanent; }
if ($args ~* ^fp=1Tgjx5dMRfTuNdV7YzG67epdWavX6sg1tXmB1CiR4tYZw4SIbdtU8Zehb0HVM1fa9NSRt5nlpAxABFNs\%2FygqQA\%3D\%3D&prvtof=kUQCDKu\%2FQQE6ood8tow\%2FaS8skAAkdEsiw9cCG9rOJio\%3D&poru=zRcPYUDWPng\%2F8DJJAvtzhZeai\%2B3h4wqnB\%2FSN4jH4NvsVysA62xeDi33g8cUA1WA6zFeP8M9P80VUP5zJQYOb6Q\%3D\%3D&$){ rewrite ^/$ /files/M9P80VUP5zJQYOb6Q---_kq6zni4znkjahdv5uz6d5w? permanent; }
rewrite ^/careers\.php$ /http-www.slm.net/careers? permanent;
if($is_args = ''){ rewrite ^/index\.php$ /index_php? permanent; }
rewrite ^/www\.slm\.net/careers\.php$ /_www.slm.net/careers? 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
