博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
.htaccess文件_使用.htaccess附加和附加文件
阅读量:2518 次
发布时间:2019-05-11

本文共 1031 字,大约阅读时间需要 3 分钟。

.htaccess文件

One of the lessor known and used capabilities of .htaccess files is the ability to prepend and append includes to every page request.  Doing so avoids needing to code <?php require('footer.php'); ?> in every template file you wat to use them in.  Here's the .htaccess code:

.htaccess文件的一点已知和使用的功能之一是,可以在每个页面请求之前添加和附加包括。 这样做避免了编写<?php require('footer.php'); ?>代码<?php require('footer.php'); ?> 您想要在其中使用的每个模板文件中的<?php require('footer.php'); ?> 。这是.htaccess代码:

# Prepend the filephp_value auto_prepend_file "/dir/path/utilities.php"# Append file to bottom of pagephp_value auto_append_file "/dir/path/templates/footer.php"

Now don't mistake this post as me telling you to use this strategy;  using this functionality creates a layer of indirection that could confuse a team of developers if they don't all have a grasp of where automatically included files are coming from.  Just wanted to let you know this was possible!

现在,请不要误解我告诉您使用此策略的帖子; 使用此功能会创建一个间接层,如果开发人员团队无法完全掌握自动包含的文件的来源,则可能会使他们感到困惑。 只是想让您知道这是可能的!

翻译自:

.htaccess文件

转载地址:http://htpwd.baihongyu.com/

你可能感兴趣的文章
sessionStorage
查看>>
代码示例_进程
查看>>
Java中关键词之this,super的使用
查看>>
学习进度
查看>>
“此人不存在”
查看>>
github.com加速节点
查看>>
解密zend-PHP凤凰源码程序
查看>>
python3 序列分片记录
查看>>
Atitit.git的存储结构and 追踪
查看>>
atitit 读书与获取知识资料的attilax的总结.docx
查看>>
B站 React教程笔记day2(3)React-Redux
查看>>
找了一个api管理工具
查看>>
Part 2 - Fundamentals(4-10)
查看>>
使用Postmark测试后端存储性能
查看>>
NSTextView 文字链接的定制化
查看>>
第五天站立会议内容
查看>>
ATMEGA16 IOport相关汇总
查看>>
JAVA基础-多线程
查看>>
面试题5:字符串替换空格
查看>>
[Codevs] 线段树练习5
查看>>