dqv84329 2016-02-01 16:46
浏览 28

在htaccess中命令apache进程规则

I have a very complex directory structure in this server I am working and lots of htaccess on multilevel. I know apache merges the configurations from all htaccess but it's not that easy as it sounds...

For example, if an htaccess file close to the root makes use of "Filesmatch" to set configurations, then if I try to change those same configurations in another htaccess file on a deeper directory without using "Filesmatch" the configurations are not changed. I realized I can only change them if I use Filesmatch ".*".

I think I know why: apache processes some things first and others later despite the order they are placed inside an htaccess file.

So I would like to know this: is there a solid documentation where I can see clearly what apache processes first and what later? I mean, even in the same htaccess files some rules "dont look" to work in the exact order they appear inside the file cause somethings are probably executed in a different order.

  • 写回答

1条回答 默认 最新

  • doumen5895 2016-02-01 17:59
    关注

    Asking this question to Apache community they provided me the answer very easily! It's here: https://httpd.apache.org/docs/2.4/sections.html#merging

    The configuration sections are applied in a very particular order. Since this can have important effects on how configuration directives are interpreted, it is important to understand how this works. The configuration sections are applied in a very particular order. Since this can have important effects on how configuration directives are interpreted, it is important to understand how this works.

    The order of merging is:

    • <Directory> (except regular expressions) and .htaccess done simultaneously (with .htaccess, if allowed, overriding <Directory>)
    • <DirectoryMatch> (and <Directory "~">)
    • <Files> and <FilesMatch> done simultaneously
    • <Location> and <LocationMatch> done simultaneously
    • <If>
    评论

报告相同问题?

悬赏问题

  • ¥50 三种调度算法报错 有实例
  • ¥15 关于#python#的问题,请各位专家解答!
  • ¥200 询问:python实现大地主题正反算的程序设计,有偿
  • ¥15 smptlib使用465端口发送邮件失败
  • ¥200 总是报错,能帮助用python实现程序实现高斯正反算吗?有偿
  • ¥15 对于squad数据集的基于bert模型的微调
  • ¥15 为什么我运行这个网络会出现以下报错?CRNN神经网络
  • ¥20 steam下载游戏占用内存
  • ¥15 CST保存项目时失败
  • ¥20 java在应用程序里获取不到扬声器设备