# Create pretty URLs
# End: Create pretty URLs

# Specific redirections
if($is_args = ''){ rewrite ^/index\.php$ /index_php.html? permanent; }
if ($args ~* ^album=lastup&cat=0$){ rewrite ^/gallery/thumbnails\.php$ /gallery/thumbnails_album-lastup-cat-0.html? permanent; }
if ($args ~* ^start_from=6&ucat=&archive=&subaction=&id=&$){ rewrite ^/index\.php$ /index_start_from-6-ucat--archive--subaction--id--.html? permanent; }
if ($args ~* ^start_from=12&ucat=&archive=&subaction=&id=&$){ rewrite ^/index\.php$ /index_start_from-12-ucat--archive--subaction--id--.html? permanent; }
if ($args ~* ^start_from=18&ucat=&archive=&subaction=&id=&$){ rewrite ^/index\.php$ /index_start_from-18-ucat--archive--subaction--id--.html? permanent; }
if ($args ~* ^start_from=24&ucat=&archive=&subaction=&id=&$){ rewrite ^/index\.php$ /index_start_from-24-ucat--archive--subaction--id--.html? permanent; }
if ($args ~* ^start_from=30&ucat=&archive=&subaction=&id=&$){ rewrite ^/index\.php$ /index_start_from-30-ucat--archive--subaction--id--.html? permanent; }
if ($args ~* ^start_from=36&ucat=&archive=&subaction=&id=&$){ rewrite ^/index\.php$ /index_start_from-36-ucat--archive--subaction--id--.html? permanent; }
if ($args ~* ^start_from=42&ucat=&archive=&subaction=&id=&$){ rewrite ^/index\.php$ /index_start_from-42-ucat--archive--subaction--id--.html? permanent; }
if ($args ~* ^start_from=48&ucat=&archive=&subaction=&id=&$){ rewrite ^/index\.php$ /index_start_from-48-ucat--archive--subaction--id--.html? permanent; }
if ($args ~* ^start_from=54&ucat=&archive=&subaction=&id=&$){ rewrite ^/index\.php$ /index_start_from-54-ucat--archive--subaction--id--.html? permanent; }
if ($args ~* ^start_from=60&ucat=&archive=&subaction=&id=&$){ rewrite ^/index\.php$ /index_start_from-60-ucat--archive--subaction--id--.html? permanent; }
if ($args ~* ^start_from=66&ucat=&archive=&subaction=&id=&$){ rewrite ^/index\.php$ /index_start_from-66-ucat--archive--subaction--id--.html? permanent; }
if ($args ~* ^start_from=72&ucat=&archive=&subaction=&id=&$){ rewrite ^/index\.php$ /index_start_from-72-ucat--archive--subaction--id--.html? permanent; }
if ($args ~* ^start_from=78&ucat=&archive=&subaction=&id=&$){ rewrite ^/index\.php$ /index_start_from-78-ucat--archive--subaction--id--.html? permanent; }
if ($args ~* ^start_from=84&ucat=&archive=&subaction=&id=&$){ rewrite ^/index\.php$ /index_start_from-84-ucat--archive--subaction--id--.html? permanent; }
if ($args ~* ^start_from=90&ucat=&archive=&subaction=&id=&$){ rewrite ^/index\.php$ /index_start_from-90-ucat--archive--subaction--id--.html? permanent; }
if ($args ~* ^start_from=96&ucat=&archive=&subaction=&id=&$){ rewrite ^/index\.php$ /index_start_from-96-ucat--archive--subaction--id--.html? permanent; }
if ($args ~* ^start_from=102&ucat=&archive=&subaction=&id=&$){ rewrite ^/index\.php$ /index_start_from-102-ucat--archive--subaction--id--.html? permanent; }
if ($args ~* ^start_from=108&ucat=&archive=&subaction=&id=&$){ rewrite ^/index\.php$ /index_start_from-108-ucat--archive--subaction--id--.html? permanent; }
if ($args ~* ^start_from=114&ucat=&archive=&subaction=&id=&$){ rewrite ^/index\.php$ /index_start_from-114-ucat--archive--subaction--id--.html? permanent; }
if ($args ~* ^start_from=120&ucat=&archive=&subaction=&id=&$){ rewrite ^/index\.php$ /index_start_from-120-ucat--archive--subaction--id--.html? permanent; }
if ($args ~* ^start_from=126&ucat=&archive=&subaction=&id=&$){ rewrite ^/index\.php$ /index_start_from-126-ucat--archive--subaction--id--.html? permanent; }
if ($args ~* ^start_from=132&ucat=&archive=&subaction=&id=&$){ rewrite ^/index\.php$ /index_start_from-132-ucat--archive--subaction--id--.html? permanent; }
if ($args ~* ^start_from=138&ucat=&archive=&subaction=&id=&$){ rewrite ^/index\.php$ /index_start_from-138-ucat--archive--subaction--id--.html? permanent; }
if ($args ~* ^start_from=144&ucat=&archive=&subaction=&id=&$){ rewrite ^/index\.php$ /index_start_from-144-ucat--archive--subaction--id--.html? permanent; }
if ($args ~* ^start_from=150&ucat=&archive=&subaction=&id=&$){ rewrite ^/index\.php$ /index_start_from-150-ucat--archive--subaction--id--.html? permanent; }
if ($args ~* ^start_from=156&ucat=&archive=&subaction=&id=&$){ rewrite ^/index\.php$ /index_start_from-156-ucat--archive--subaction--id--.html? permanent; }
if ($args ~* ^start_from=162&ucat=&archive=&subaction=&id=&$){ rewrite ^/index\.php$ /index_start_from-162-ucat--archive--subaction--id--.html? permanent; }
if ($args ~* ^start_from=168&ucat=&archive=&subaction=&id=&$){ rewrite ^/index\.php$ /index_start_from-168-ucat--archive--subaction--id--.html? permanent; }
if ($args ~* ^start_from=174&ucat=&archive=&subaction=&id=&$){ rewrite ^/index\.php$ /index_start_from-174-ucat--archive--subaction--id--.html? permanent; }
if ($args ~* ^start_from=180&ucat=&archive=&subaction=&id=&$){ rewrite ^/index\.php$ /index_start_from-180-ucat--archive--subaction--id--.html? permanent; }
if ($args ~* ^start_from=186&ucat=&archive=&subaction=&id=&$){ rewrite ^/index\.php$ /index_start_from-186-ucat--archive--subaction--id--.html? permanent; }
if ($args ~* ^start_from=192&ucat=&archive=&subaction=&id=&$){ rewrite ^/index\.php$ /index_start_from-192-ucat--archive--subaction--id--.html? permanent; }
if ($args ~* ^start_from=198&ucat=&archive=&subaction=&id=&$){ rewrite ^/index\.php$ /index_start_from-198-ucat--archive--subaction--id--.html? permanent; }
if ($args ~* ^start_from=204&ucat=&archive=&subaction=&id=&$){ rewrite ^/index\.php$ /index_start_from-204-ucat--archive--subaction--id--.html? permanent; }
if ($args ~* ^start_from=210&ucat=&archive=&subaction=&id=&$){ rewrite ^/index\.php$ /index_start_from-210-ucat--archive--subaction--id--.html? permanent; }
if ($args ~* ^start_from=216&ucat=&archive=&subaction=&id=&$){ rewrite ^/index\.php$ /index_start_from-216-ucat--archive--subaction--id--.html? permanent; }
if ($args ~* ^start_from=222&ucat=&archive=&subaction=&id=&$){ rewrite ^/index\.php$ /index_start_from-222-ucat--archive--subaction--id--.html? permanent; }
if ($args ~* ^start_from=228&ucat=&archive=&subaction=&id=&$){ rewrite ^/index\.php$ /index_start_from-228-ucat--archive--subaction--id--.html? permanent; }
if ($args ~* ^start_from=234&ucat=&archive=&subaction=&id=&$){ rewrite ^/index\.php$ /index_start_from-234-ucat--archive--subaction--id--.html? permanent; }
if ($args ~* ^start_from=240&ucat=&archive=&subaction=&id=&$){ rewrite ^/index\.php$ /index_start_from-240-ucat--archive--subaction--id--.html? permanent; }
if ($args ~* ^start_from=246&ucat=&archive=&subaction=&id=&$){ rewrite ^/index\.php$ /index_start_from-246-ucat--archive--subaction--id--.html? permanent; }
if ($args ~* ^start_from=252&ucat=&archive=&subaction=&id=&$){ rewrite ^/index\.php$ /index_start_from-252-ucat--archive--subaction--id--.html? permanent; }
if ($args ~* ^start_from=258&ucat=&archive=&subaction=&id=&$){ rewrite ^/index\.php$ /index_start_from-258-ucat--archive--subaction--id--.html? permanent; }
if ($args ~* ^start_from=264&ucat=&archive=&subaction=&id=&$){ rewrite ^/index\.php$ /index_start_from-264-ucat--archive--subaction--id--.html? permanent; }
if ($args ~* ^start_from=270&ucat=&archive=&subaction=&id=&$){ rewrite ^/index\.php$ /index_start_from-270-ucat--archive--subaction--id--.html? permanent; }
if ($args ~* ^start_from=276&ucat=&archive=&subaction=&id=&$){ rewrite ^/index\.php$ /index_start_from-276-ucat--archive--subaction--id--.html? permanent; }
if ($args ~* ^start_from=282&ucat=&archive=&subaction=&id=&$){ rewrite ^/index\.php$ /index_start_from-282-ucat--archive--subaction--id--.html? permanent; }
if ($args ~* ^start_from=288&ucat=&archive=&subaction=&id=&$){ rewrite ^/index\.php$ /index_start_from-288-ucat--archive--subaction--id--.html? permanent; }
if ($args ~* ^start_from=294&ucat=&archive=&subaction=&id=&$){ rewrite ^/index\.php$ /index_start_from-294-ucat--archive--subaction--id--.html? permanent; }
if ($args ~* ^start_from=300&ucat=&archive=&subaction=&id=&$){ rewrite ^/index\.php$ /index_start_from-300-ucat--archive--subaction--id--.html? permanent; }
if ($args ~* ^start_from=306&ucat=&archive=&subaction=&id=&$){ rewrite ^/index\.php$ /index_start_from-306-ucat--archive--subaction--id--.html? permanent; }
if ($args ~* ^start_from=312&ucat=&archive=&subaction=&id=&$){ rewrite ^/index\.php$ /index_start_from-312-ucat--archive--subaction--id--.html? permanent; }
if ($args ~* ^start_from=318&ucat=&archive=&subaction=&id=&$){ rewrite ^/index\.php$ /index_start_from-318-ucat--archive--subaction--id--.html? permanent; }
if ($args ~* ^start_from=324&ucat=&archive=&subaction=&id=&$){ rewrite ^/index\.php$ /index_start_from-324-ucat--archive--subaction--id--.html? permanent; }
if ($args ~* ^cat=34$){ rewrite ^/gallery/index\.php$ /gallery/index_cat-34.html? permanent; }
if ($args ~* ^referer=index\.php$){ rewrite ^/gallery/login\.php$ /gallery/login_referer-index_php.html? permanent; }
if ($args ~* ^cat=0$){ rewrite ^/gallery/index\.php$ /gallery/index_cat-0.html? permanent; }
if ($args ~* ^album=lastcom&cat=0$){ rewrite ^/gallery/thumbnails\.php$ /gallery/thumbnails_album-lastcom-cat-0.html? permanent; }
if ($args ~* ^album=topn&cat=0$){ rewrite ^/gallery/thumbnails\.php$ /gallery/thumbnails_album-topn-cat-0.html? permanent; }
if ($args ~* ^album=toprated&cat=0$){ rewrite ^/gallery/thumbnails\.php$ /gallery/thumbnails_album-toprated-cat-0.html? permanent; }
if ($args ~* ^album=favpics$){ rewrite ^/gallery/thumbnails\.php$ /gallery/thumbnails_album-favpics.html? permanent; }
if ($args ~* ^cat=11$){ rewrite ^/gallery/index\.php$ /gallery/index_cat-11.html? permanent; }
if ($args ~* ^cat=8$){ rewrite ^/gallery/index\.php$ /gallery/index_cat-8.html? permanent; }
if ($args ~* ^cat=13$){ rewrite ^/gallery/index\.php$ /gallery/index_cat-13.html? permanent; }
if ($args ~* ^cat=7$){ rewrite ^/gallery/index\.php$ /gallery/index_cat-7.html? permanent; }
if ($args ~* ^cat=4$){ rewrite ^/gallery/index\.php$ /gallery/index_cat-4.html? permanent; }
if ($args ~* ^cat=5$){ rewrite ^/gallery/index\.php$ /gallery/index_cat-5.html? permanent; }
if ($args ~* ^cat=6$){ rewrite ^/gallery/index\.php$ /gallery/index_cat-6.html? permanent; }
if ($args ~* ^cat=12$){ rewrite ^/gallery/index\.php$ /gallery/index_cat-12.html? permanent; }
if ($args ~* ^album=lastup&cat=0&pid=4113$){ rewrite ^/gallery/displayimage\.php$ /gallery/displayimage_album-lastup-cat-0-pid-4113.html? permanent; }
if ($args ~* ^album=lastup&cat=0&pid=4112$){ rewrite ^/gallery/displayimage\.php$ /gallery/displayimage_album-lastup-cat-0-pid-4112.html? permanent; }
if ($args ~* ^album=lastup&cat=0&pid=4111$){ rewrite ^/gallery/displayimage\.php$ /gallery/displayimage_album-lastup-cat-0-pid-4111.html? permanent; }
if ($args ~* ^album=lastup&cat=0&pid=4110$){ rewrite ^/gallery/displayimage\.php$ /gallery/displayimage_album-lastup-cat-0-pid-4110.html? permanent; }
if ($args ~* ^lang=xxx$){ rewrite ^/gallery/index\.php$ /gallery/index_lang-xxx.html? permanent; }

# 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
