diff --git a/.htaccess b/.htaccess
index 4beb0cf..8f92ac4 100644
--- a/.htaccess
+++ b/.htaccess
@@ -1 +1,6 @@
php_flag opcache.enable off
+
+
+ RewriteEngine on
+ RewriteRule ^book/([0-9]+)/.*$ download.php?id=$1
+
diff --git a/js/books.js b/js/books.js
index 2180ac8..d400818 100644
--- a/js/books.js
+++ b/js/books.js
@@ -54,6 +54,10 @@ function redirectToLogin() {
window.location.replace("index.php");
}
+function basename(str) {
+ return str.substr(str.lastIndexOf("/") + 1);
+}
+
function getContents() {
if ( searchTimeout ) clearTimeout(searchTimeout);
var data = {};
@@ -88,9 +92,9 @@ function getContents() {
if ( item.folder == true ) {
contents += '
' + item.displayname + "
";
} else {
- contents += '