【发布时间】:2011-09-19 18:28:06
【问题描述】:
我是 htaccess 的新手,遇到了一些需要帮助的问题。在我的站点中,我有一个文件夹(实际上是空白的),我想为其提供根文件夹中的内容。
假设结构如下:
example.com
-folder1
-index.php
-anotherpage.php
-.htaccess
因此,当有人访问 example.com/folder1/index.php 时,他会看到该 url,但会从 example.com/index.php 获取内容。如果他访问 example.com/folder1/anotherpage.php,他将从 example.com/anotherpage.php 获取内容。当然,当他直接访问 example.com/index.php 时,他会看到 example.com/index.php。
我发现很多例子显示相反但不是我想要的。另外澄清一下,我想重写,而不是重定向,所以 url 会假装在 folder1 中实际上有页面。
任何帮助将不胜感激。
【问题讨论】:
标签: .htaccess mod-rewrite