httpd 中目录指令的尾部斜杠

Maj*_*imi 5 httpd

这些配置之间有什么区别:

<Directory /var/www>
.....
</Directory>
Run Code Online (Sandbox Code Playgroud)

<Directory /var/www/>
.....
</Directory>
Run Code Online (Sandbox Code Playgroud)

Cal*_*leb 5

否定的,应该没有区别,尽管前者应该被定义为首选以符合 Apache 记录在案的这种形式的偏好。对于其他指令,例如 DocumentRoot 和 Location,它有所作为,因此您应该始终避免在 apache 配置中使用尾部斜杠。