diff --git a/xmlsitemap.pages.inc b/xmlsitemap.pages.inc
index c958f95..4604d1a 100644
--- a/xmlsitemap.pages.inc
+++ b/xmlsitemap.pages.inc
@@ -12,7 +12,7 @@
  */
 function xmlsitemap_get_current_chunk(stdClass $sitemap) {
   // Check if we should be displaing the index.
-  if (!isset($_GET['page']) || !is_numeric($_GET['page'])) {
+  if (!is_numeric(arg(1)) && (!isset($_GET['page']) || !is_numeric($_GET['page']))) {
     if ($sitemap->chunks > 1) {
       return 'index';
     }
@@ -21,6 +21,7 @@ function xmlsitemap_get_current_chunk(stdClass $sitemap) {
     }
   }
   else {
+    if (is_numeric(arg(1))) return arg(1);
     return (int) $_GET['page'];
   }
 }
@@ -113,7 +114,7 @@ function xmlsitemap_file_transfer($source, $headers) {
   // Transfer file in 16 KB chunks to save memory usage.
   if ($handle = fopen($source, 'rb')) {
     while (!feof($handle)) {
-      print fread($handle, 1024*16);
+      print str_replace("?page=","/",fread($handle, 1024*16));
     }
     fclose($handle);
   }
