Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
ikeigenwijs CreditAttribution: ikeigenwijs commentedSome 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
Comment #2
johnhanley CreditAttribution: johnhanley commented@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
Comment #3
ikeigenwijs CreditAttribution: ikeigenwijs commentedAs far as i can tell yes.
It works as expected now.
Comment #4
johnhanley CreditAttribution: johnhanley commentedExcellent--good to hear!
I'll close this issue, but perhaps the information will be useful to others.
Thanks again for sharing your findings.