CyberPanel Community

FilesMatch doesn't work

ad
adami #1

hi
<FilesMatch “.(?i:pdf)$”>
ForceType application/octet-stream
Header set Content-Disposition attachment
…added to .htaccess but doesn’t work
please help
thanks you

6 replies
NK
Nitesh Kunnath #2

Any major changes to htaccess files need Openlitespeed Restart. Go to Manage Services menu of cyberpanel and then restart Openlitespeed

NK
Nitesh Kunnath #3

I really missed to read the codes you mentioned.
Openlitespeed doesnt support this. Rewrite and rewritecond rules are only supported by Openlitespeed.

ad
adami #4

thanks for reply.
Is there a similar solution compatible with Lightspeed ?
Create a context for example…
And if that is possible…how do i translate this filematch code to context.

ad
adami #6

problem solved :slight_smile:

solution :

context exp:^.*(pdf)$ {
allowBrowse 1
extraHeaders <<<END_extraHeaders
ForceType application/octet-stream
Header set Content-Disposition attachment
END_extraHeaders

rewrite {

}
addDefaultCharset off

phpIniOverride {

}
}

thanks you.

jo
johanjj #7

thankss :grinning: :grinning: :grinning: :grinning:

Sign in to reply