【发布时间】:2015-10-16 21:25:14
【问题描述】:
我对 htaccess 做的不多,通常使用已经制作好的框架。我检查了多个站点来学习 htaccess,但它们都遇到了一些难以掌握的情况。我尝试了一些乱码,并在stackoverflow上查看其他地方,我发现了一些可以执行第一个目录或有限集的内容,但没有进一步,而且我没有运气。
我正在寻找的是这样做......
用户在地址栏中输入(或浏览到)以下内容之一...
example.com
example.com/foo/bar/
example.com/some/really/long/set/of/directories/.../that/seems/to/go/on/forever
并最终将所有重定向到由处理
example.com/index.php
用一个数组填充路径如
// in index.php
print_r (myarray);
// printing something like...
// []
// or
// ["foo", "bar"]
// or
// ["some", "really", "long", "set", "of", "directories", ... , "that", "seems", "to", "go", "on", "forever"]
// respectively.
【问题讨论】:
标签: php apache .htaccess directory