我有一个索引文件,它可以加载我页面的大部分可视部分(页眉,页脚等),并使用includes来填充子页面中的内容。不幸的是,这意味着我的链接看起来像domain/index.php?page=contact
rathar而不是domain/contact
。
我将如何以良好的方式实现后一种结构?
答案 0 :(得分:2)
阅读.htaccess和mod_rewrite
答案 1 :(得分:2)
Apache's mod_rewrite正是您要找的。有关易于理解的示例,请参见第2页。
RewriteRule /domain/contact domain/index.php?page=contact