diff --git a/mwclient/client.py b/mwclient/client.py
index 791783b76722e7454dd2d2ebf7d716ad44097fe7..e6d052c951ee8ce3517a6eca509fbb9a1e4c67c2 100644
--- a/mwclient/client.py
+++ b/mwclient/client.py
@@ -34,11 +34,12 @@ class WaitToken(object):
 
 class Site(object):
 	api_limit = 500
-	def __init__(self, host, path = '/w/', pool = None, retry_timeout = 30, 
+	def __init__(self, host, path = '/w/', ext = '.php', pool = None, retry_timeout = 30, 
 			max_retries = 25, wait_callback = lambda *x: None, 
 			max_lag = 3, compress = True, force_login = True, do_init = True):
 		self.host = host
 		self.path = path
+		self.ext = ext
 		self.credentials = None
 		self.compress = compress
 		
@@ -163,7 +164,7 @@ class Site(object):
 		return qs
 		
 	def raw_call(self, script, data):
-		url = self.path + script + '.php'
+		url = self.path + script + self.ext
 		headers = {'Content-Type': 'application/x-www-form-urlencoded'}
 		if self.compress and gzip:
 			headers['Accept-Encoding'] = 'gzip'
diff --git a/mwclient/ex.py b/mwclient/ex.py
index 85cadbbe0474f4b779d5b2cb7bed68fe016ff485..afb77d950a9562b5b6b7ed93225162d5bcd2026a 100644
--- a/mwclient/ex.py
+++ b/mwclient/ex.py
@@ -38,8 +38,9 @@ class ConfiguredSite(client.Site):
 		
 		do_login = 'username' in self.config and 'password' in self.config
 		
-		client.Site.__init__(self, self.config['host'],
-			self.config['path'], do_init = not do_login,
+		client.Site.__init__(self, host = self.config['host'],
+			path = self.config['path'], ext = self.config.get('ext', '.php'), 
+			do_init = not do_login,
 			retry_timeout  = self.config.get('retry_timeout', 30),
 			max_retries = self.config.get('max_retries', -1))
 			
@@ -63,8 +64,9 @@ class ConfiguredPool(list):
 			
 			do_login = 'username' in site and 'password' in site
 					
-			self.append(client.Site(site['host'], 
-				site['path'], self.pool, do_init = not do_login,
+			self.append(client.Site(host = site['host'], 
+				path = site['path'], ext = site.get('ext', '.php'),
+				pool = self.pool, do_init = not do_login,
 				retry_timeout = site.get('retry_timeout', 30),
 				max_retries = site.get('max_retries', -1)))
 			if do_login: