Some rules in the .htaccess seem outdated.
FilesMatch pattern to protect files and directories form direct access needs to be updated. For instance tpl(\.php)? makes no sense in Drupal 8+.
Configuration for PHP 5 is no longer needed as Drupal does not support PHP 5 since version 8.7.
Overall the current configuration seems too complex and likely can be optimized. The number of rules in the .htaccess may affect server performance a great deal. That's because the file is parsed on each http request including requests for static files.
We may consider moving rules that specific to some directory into a separate .htaccess file located under that directory. For instance there is a large set of rules for serving gzip compressed CSS and JS files.
| Comment | File | Size | Author |
|---|---|---|---|
| #22 | 3124724-nr-bot.txt | 144 bytes | needs-review-queue-bot |
| #14 | interdiff_10-14.txt | 340 bytes | vsujeetkumar |
| #14 | 3124724_14.patch | 1.64 KB | vsujeetkumar |
| #10 | interdiff_8-10.txt | 868 bytes | suresh prabhu parkala |
| #10 | 3124724-10.patch | 1.84 KB | suresh prabhu parkala |
Comments
Comment #2
neslee canil pintoComment #4
neslee canil pintoComment #6
init90Needs update after #2455465: Add mod_php7 check to htaccess and remove php5 code
Comment #7
adityasingh commentedworking on reroll
Comment #8
adityasingh commentedReroll for 9.1
Comment #9
init90This part is needed and shouldn't be removed.
Comment #10
suresh prabhu parkala commentedPlease review!
Comment #12
longwaveThe issue summary says
I think if we are going to revise the list of blocked file extensions then we should consider all of them. For example at first glance "xtmpl" appears in the list - I believe this refers to the XTemplate templating system, which was deprecated in Drupal 4.7! I think it is worth someone listing out all the extensions included in this list, determining what they are used for, and then deciding whether they still should be included.
Also, there is a near-identical regex in web.config, which is used on IIS. This regex should be updated to match.
Comment #13
longwaveBetter title.
Comment #14
vsujeetkumar commentedFixing test.
Comment #15
init90Comment #16
tvb commentedComment #22
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.