Index: src/wp-includes/rest-api.php
===================================================================
--- src/wp-includes/rest-api.php	(revision 38764)
+++ src/wp-includes/rest-api.php	(working copy)
@@ -93,8 +93,11 @@
  * @see add_rewrite_rule()
  */
 function rest_api_register_rewrites() {
+	global $wp_rewrite;
 	add_rewrite_rule( '^' . rest_get_url_prefix() . '/?$','index.php?rest_route=/','top' );
 	add_rewrite_rule( '^' . rest_get_url_prefix() . '/(.*)?','index.php?rest_route=/$matches[1]','top' );
+	add_rewrite_rule( '^' . $wp_rewrite->index . '/' . rest_get_url_prefix() . '/?$','index.php?rest_route=/','top' );
+	add_rewrite_rule( '^' . $wp_rewrite->index . '/' . rest_get_url_prefix() . '/(.*)?','index.php?rest_route=/$matches[1]','top' );
 }
 
 /**
@@ -188,7 +191,12 @@
 	}
 
 	if ( is_multisite() && get_blog_option( $blog_id, 'permalink_structure' ) || get_option( 'permalink_structure' ) ) {
-		$url = get_home_url( $blog_id, rest_get_url_prefix(), $scheme );
+		global $wp_rewrite;
+		if ( $wp_rewrite->using_index_permalinks() ) {
+			$url = get_home_url( $blog_id, $wp_rewrite->index . '/' . rest_get_url_prefix(), $scheme );
+		} else {
+			$url = get_home_url( $blog_id, rest_get_url_prefix(), $scheme );
+		}
 		$url .= '/' . ltrim( $path, '/' );
 	} else {
 		$url = trailingslashit( get_home_url( $blog_id, '', $scheme ) );
Index: tests/phpunit/tests/rest-api.php
===================================================================
--- tests/phpunit/tests/rest-api.php	(revision 38764)
+++ tests/phpunit/tests/rest-api.php	(working copy)
@@ -273,11 +273,15 @@
 	 */
 	public function test_rest_url_generation() {
 		// In pretty permalinks case, we expect a path of wp-json/ with no query.
-		update_option( 'permalink_structure', '/%year%/%monthnum%/%day%/%postname%/' );
+		$this->set_permalink_structure( '/%year%/%monthnum%/%day%/%postname%/' );
 		$this->assertEquals( 'http://' . WP_TESTS_DOMAIN . '/wp-json/', get_rest_url() );
 
-		update_option( 'permalink_structure', '' );
+		// In index permalinks case, we expect a path of index.php/wp-json/ with no query.
+		$this->set_permalink_structure( '/index.php/%year%/%monthnum%/%day%/%postname%/' );
+		$this->assertEquals( 'http://' . WP_TESTS_DOMAIN . '/index.php/wp-json/', get_rest_url() );
+
 		// In non-pretty case, we get a query string to invoke the rest router.
+		$this->set_permalink_structure( '' );
 		$this->assertEquals( 'http://' . WP_TESTS_DOMAIN . '/?rest_route=/', get_rest_url() );
 
 	}
