I got private download working on all sites but 1. (took me a while)

And i found the solution(i think) but i dont exactly know how to implement it.

Its a site with clean url turned off.
standart htaccess

<IfModule mod_rewrite.c>
  RewriteEngine on
  RewriteBase /system/files/private
  RewriteRule ^(.*)$ $1 [L,R=301]
</IfModule>

http://www.revaki.ugent.be/sites/default/files/private/werkgroep/Carat_p...

rewrite gives correctly as expected by instructions
http://www.revaki.ugent.be/system/files/private/werkgroep/Carat_plaatsin...

But i want:(because this seems to work)
http://www.revaki.ugent.be/?q=system/files/private/werkgroep/Carat_plaat...

So in short how to modify the htaccess file to add the "?q="

thx a lot

Comments

ikeigenwijs’s picture

Some attempts:
RewriteBase /system/files/private
RewriteRule ^(.*)$ \?q=$1 [L,R=301]
gave
http://www.revaki.ugent.be/system/files/private/?q=werkgroep/Carat_plaat...

this:
RewriteRule ^(.*)$ \?q=system/files/private/$1 [L,R=301]
gave:
http://www.revaki.ugent.be/www/_shares/_revaki/WWW/sites/default/files/p...

The solution i now use and seems to do the trick:
RewriteBase /
RewriteRule ^(.*)$ \?q=system/files/private/$1 [L,R=301]

gave: http://www.revaki.ugent.be/?q=system/files/private/werkgroep/Carat_plaat... when blocked
gave: http://www.revaki.ugent.be/sites/default/files/private/werkgroep/Carat_p... when allowed

johnhanley’s picture

@ikeigenwijs,

To be honest, I've never tested Private Download w/ clean URLs disabled. However, the module strives to be system compliant and should work just fine. So, in summary and to confirm, doing what you describe in the latter part of your second post does in fact work?

Thanks,
John

ikeigenwijs’s picture

As far as i can tell yes.
It works as expected now.

johnhanley’s picture

Status: Active » Closed (fixed)

Excellent--good to hear!

I'll close this issue, but perhaps the information will be useful to others.

Thanks again for sharing your findings.