# Specific redirections
if ($args ~* ^n=CloudNSciLtd\.CloudNSciLtd$){ rewrite ^/wiki/index\.php$ /wiki/index_n-CloudNSciLtd_CloudNSciLtd? permanent; }
if ($args ~* ^n=Providers\.AgienceOyLtd$){ rewrite ^/wiki/index\.php$ /wiki/index_n-Providers_AgienceOyLtd? permanent; }
if ($args ~* ^n=Providers\.MyAlgorithmsLtd$){ rewrite ^/wiki/index\.php$ /wiki/index_n-Providers_MyAlgorithmsLtd? permanent; }
if ($args ~* ^n=Main\.HomePage$){ rewrite ^/wiki/index\.php$ /wiki/index_n-Main_HomePage? permanent; }
if ($args ~* ^n=Main$){ rewrite ^/wiki/index\.php$ /wiki/index_n-Main? permanent; }
if ($args ~* ^n=News\.News$){ rewrite ^/wiki/index\.php$ /wiki/index_n-News_News? permanent; }
if ($args ~* ^n=UserGuide\.ConceptualDesign$){ rewrite ^/wiki/index\.php$ /wiki/index_n-UserGuide_ConceptualDesign? permanent; }
if ($args ~* ^n=HeatMiner\.Demos$){ rewrite ^/wiki/index\.php$ /wiki/index_n-HeatMiner_Demos? permanent; }
if ($args ~* ^n=QuickGuide\.QuickGuide$){ rewrite ^/wiki/index\.php$ /wiki/index_n-QuickGuide_QuickGuide? permanent; }
if ($args ~* ^n=DeveloperGuide\.DeveloperGuide$){ rewrite ^/wiki/index\.php$ /wiki/index_n-DeveloperGuide_DeveloperGuide? permanent; }
if ($args ~* ^n=HeatMiner\.HeatMiner$){ rewrite ^/wiki/index\.php$ /wiki/index_n-HeatMiner_HeatMiner? permanent; }
if ($args ~* ^n=AlgorithmicChallenges\.AlgorithmicChallenges$){ rewrite ^/wiki/index\.php$ /wiki/index_n-AlgorithmicChallenges_AlgorithmicChallenges? permanent; }
if ($args ~* ^n=WonderSorting\.WonderSorting$){ rewrite ^/wiki/index\.php$ /wiki/index_n-WonderSorting_WonderSorting? permanent; }
if ($args ~* ^n=ProviderGuide\.ProviderGuide$){ rewrite ^/wiki/index\.php$ /wiki/index_n-ProviderGuide_ProviderGuide? permanent; }
if ($args ~* ^n=Archive\.HeatMiner-20-beta$){ rewrite ^/wiki/index\.php$ /wiki/index_n-Archive_HeatMiner-20-beta? permanent; }
if ($args ~* ^n=Archive\.The-Hottest-Startups-in-Finland$){ rewrite ^/wiki/index\.php$ /wiki/index_n-Archive_The-Hottest-Startups-in-Finland? permanent; }
if ($args ~* ^n=Archive\.Cloud-Park-Adventures-episode-2$){ rewrite ^/wiki/index\.php$ /wiki/index_n-Archive_Cloud-Park-Adventures-episode-2? permanent; }
if ($args ~* ^n=Archive\.ECML-PKDD-2012$){ rewrite ^/wiki/index\.php$ /wiki/index_n-Archive_ECML-PKDD-2012? permanent; }
if ($args ~* ^n=Archive\.Classification-Algorithm-Challenge-1$){ rewrite ^/wiki/index\.php$ /wiki/index_n-Archive_Classification-Algorithm-Challenge-1? permanent; }
if ($args ~* ^n=Archive\.Why-did-CloudNSci-create-the-Algorithms-as-a-Service-concept$){ rewrite ^/wiki/index\.php$ /wiki/index_n-Archive_Why-did-CloudNSci-create-the-Algorithms-as-a-Service-concept? permanent; }
if ($args ~* ^n=Archive\.Alerts-via-Twitter$){ rewrite ^/wiki/index\.php$ /wiki/index_n-Archive_Alerts-via-Twitter? permanent; }
if ($args ~* ^n=Archive\.Presentations-at-SlideShare$){ rewrite ^/wiki/index\.php$ /wiki/index_n-Archive_Presentations-at-SlideShare? permanent; }
if ($args ~* ^n=Archive\.Information-Desk-opened$){ rewrite ^/wiki/index\.php$ /wiki/index_n-Archive_Information-Desk-opened? permanent; }
if ($args ~* ^n=Info\.Info$){ rewrite ^/wiki/index\.php$ /wiki/index_n-Info_Info? permanent; }
if ($args ~* ^n=Main\.Contact$){ rewrite ^/wiki/index\.php$ /wiki/index_n-Main_Contact? permanent; }
if ($args ~* ^n=CloudParkAdventures\.CloudParkAdventures$){ rewrite ^/wiki/index\.php$ /wiki/index_n-CloudParkAdventures_CloudParkAdventures? permanent; }
if ($args ~* ^n=HeatMiner\.Gallery$){ rewrite ^/wiki/index\.php$ /wiki/index_n-HeatMiner_Gallery? permanent; }
if ($args ~* ^n=MaskOMatic\.MaskOMatic$){ rewrite ^/wiki/index\.php$ /wiki/index_n-MaskOMatic_MaskOMatic? permanent; }
if ($args ~* ^n=Specifications\.Specifications$){ rewrite ^/wiki/index\.php$ /wiki/index_n-Specifications_Specifications? permanent; }
if ($args ~* ^n=Site\.SideBar$){ rewrite ^/wiki/index\.php$ /wiki/index.php-n-Site_action-login? permanent; }
if ($args ~* ^n=About\.Thanks$){ rewrite ^/wiki/index\.php$ /wiki/index_n-About_Thanks? 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
