-
Notifications
You must be signed in to change notification settings - Fork 228
Url Rewriting with COPS
Sébastien Lucas edited this page Jul 22, 2013
·
11 revisions
The Kobo eReader Touch's browser cannot download through php file (the extension has to be known). To allow downloading on this eReader, you must enable Url Rewriting (cops_use_url_rewriting).
- Nginx :
location /download/ {
rewrite ^/download/(\d+)/(\d+)/.*\.(.*)$ /fetch.php?data=$1&db=$2&type=$3 last;
rewrite ^/download/(\d+)/.*\.(.*)$ /fetch.php?data=$1&type=$2 last;
break;
}
-
Apache : Should work out of the box with the supplied .htaccess
-
Cherokee (Thanks to Christophe) :
- Add a Behavior of type Regular Expression :
/cops/download/(.*)/.*\.(.*)$
- Choose the handler Redirection
- Add the substitution regexp :
/cops/download/(.*)/.*\.(.*)$" --> "/cops/fetch.php?data=$1&type=$2
- Add a Behavior of type Regular Expression :