Open KrSi78 opened 4 months ago
Hi @KrSi78 Thanks. Just to be sure to understand you, you mean that when you only ask for a subfolder (not a file), the existing rule doesn't work, right? (it fires but generates a 403) Asking so that I can reproduce it quickly.
That's correct. We use links on the home page of the courses to link to specific folders. The existing rule fires but results in a 403 as directory listing is turned off. The rule ChatGPT suggests tackles this as the rule doesn't match when the URL doesn't end on a dot succeeded by one of the media file type extensions mentioned.
Op za 6 jul 2024 om 17:35 schreef Yannick Warnier @.***
:
Hi @KrSi78 https://github.com/KrSi78 Thanks. Just to be sure to understand you, you mean that when you only ask for a subfolder (not a file), the existing rule doesn't work, right? (it fires but generates a 403) Asking so that I can reproduce it quickly.
— Reply to this email directly, view it on GitHub https://github.com/chamilo/chamilo-lms/issues/5637#issuecomment-2211799410, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEBIW35SLXUO7BOWAEBC5W3ZLAFEXAVCNFSM6AAAAABKNDEGDOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMJRG44TSNBRGA . You are receiving this because you were mentioned.Message ID: @.***>
The topic Removing files download permissions check in the Chamilo Optimization Guide (
/documentation/optimization.html
if not deleted after installation) suggests to introduce the following rewrite rule:Unfortunately, that results in a 403 error when for a given course a document subfolder is called using a path (
/courses/course_code/document/folder
) instead of calling the PHP-script (/main/document/document.php?cidReq=....
).I've asked ChatGPT for a correction and it came up with the following:
The corrected rewrite rule expects a dot followed by one of the extensions listed, but doesn't fire when the dot is missing, exactly what we want so when linking to a subfolder,
document.php
is called anyway.