我在我的 Mac 上使用 apache 服务器,一切正常。
现在我有一个网页,它index.php
非常复杂: 在index.php
中,它需要像这样的 url:localhost/~username/hostname/page_a
。其内容page_a
实际上是.php
存储在content
文件夹中的文件。所以在 中index.php
,它只是解析page_a
,并做一个 include: '' 来呈现请求页面。
但是在.htaccess
中,重定向规则没有正确配置。
例如,如果我点击一个链接:localhost/~username/hostname/page_a
,有没有办法将这个url重定向到index.php
,同时该url仍然是localhost/~username/hostname/page_a
,这样index.php
才能正确解析和呈现它?
谢谢。