diff --git a/config/apache/standardebooks.org.conf b/config/apache/standardebooks.org.conf
index d384779b..f9885203 100644
--- a/config/apache/standardebooks.org.conf
+++ b/config/apache/standardebooks.org.conf
@@ -165,11 +165,7 @@ Define domain standardebooks.org
RewriteRule ^/(.+?)/$ /$1 [R=301,L]
# Redirect ToC of XHTML representation of books
- RewriteRule ^/ebooks/(.+?)/text$ /ebooks/$1/src/epub/toc.xhtml [L]
-
- # Redirect XHTML representation of books
- # This has to appear before the next check, so that we can exclude .xhtml endings
- RewriteRule ^/ebooks/(.+?)/(text|css|images|fonts)(.*) /ebooks/$1/src/epub/$2$3
+ RewriteRule ^/ebooks/(.+?)/text$ /ebooks/$1/toc.xhtml [L]
# Received: /filename and /filename.xhtml exists in filesystem; Result: rewrite to /filename.xhtml
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME}.xhtml -f
@@ -228,7 +224,7 @@ Define domain standardebooks.org
# Prevent this rule from firing if we're getting a distribution file
RewriteCond %{REQUEST_FILENAME} !^/ebooks/.+?/downloads/.+$
- RewriteCond %{REQUEST_FILENAME} !^/ebooks/.+?/src/.+$
+ RewriteCond %{REQUEST_FILENAME} !^/ebooks/.+?/text.*$
RewriteRule ^/ebooks/([^\.]+?)$ /ebooks/ebook.php?url-path=$1
# If we ask for /opds/all?query=xyz, rewrite that to the search page.
diff --git a/config/apache/standardebooks.test.conf b/config/apache/standardebooks.test.conf
index 6dbd2692..ae4daa5d 100644
--- a/config/apache/standardebooks.test.conf
+++ b/config/apache/standardebooks.test.conf
@@ -164,11 +164,7 @@ Define domain standardebooks.test
RewriteRule ^/(.+?)/$ /$1 [R=301,L]
# Redirect ToC of XHTML representation of books
- RewriteRule ^/ebooks/(.+?)/text$ /ebooks/$1/src/epub/toc.xhtml [L]
-
- # Redirect XHTML representation of books
- # This has to appear before the next check, so that we can exclude .xhtml endings
- RewriteRule ^/ebooks/(.+?)/(text|css|images|fonts)(.*) /ebooks/$1/src/epub/$2$3
+ RewriteRule ^/ebooks/(.+?)/text$ /ebooks/$1/toc.xhtml [L]
# Received: /filename and /filename.xhtml exists in filesystem; Result: rewrite to /filename.xhtml
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME}.xhtml -f
@@ -227,7 +223,7 @@ Define domain standardebooks.test
# Prevent this rule from firing if we're getting a distribution file
RewriteCond %{REQUEST_FILENAME} !^/ebooks/.+?/downloads/.+$
- RewriteCond %{REQUEST_FILENAME} !^/ebooks/.+?/src/.+$
+ RewriteCond %{REQUEST_FILENAME} !^/ebooks/.+?/text.*$
RewriteRule ^/ebooks/([^\.]+?)$ /ebooks/ebook.php?url-path=$1
# If we ask for /opds/all?query=xyz, rewrite that to the search page.
diff --git a/lib/Ebook.php b/lib/Ebook.php
index fde517e8..01cc489f 100644
--- a/lib/Ebook.php
+++ b/lib/Ebook.php
@@ -75,14 +75,14 @@ class Ebook{
throw new InvalidEbookException('Invalid repo filesystem path: ' . $this->RepoFilesystemPath);
}
- if(!is_file($wwwFilesystemPath . '/src/epub/content.opf')){
- throw new InvalidEbookException('Invalid content.opf file: ' . $wwwFilesystemPath . '/src/epub/content.opf');
+ if(!is_file($wwwFilesystemPath . '/content.opf')){
+ throw new InvalidEbookException('Invalid content.opf file: ' . $wwwFilesystemPath . '/content.opf');
}
$this->WwwFilesystemPath = $wwwFilesystemPath;
$this->Url = str_replace(WEB_ROOT, '', $this->WwwFilesystemPath);
- $rawMetadata = file_get_contents($wwwFilesystemPath . '/src/epub/content.opf') ?: '';
+ $rawMetadata = file_get_contents($wwwFilesystemPath . '/content.opf') ?: '';
// Get the SE identifier.
preg_match('|