【问题标题】:Open an html or php page from another directory in www directory [duplicate]从 www 目录中的另一个目录打开 html 或 php 页面 [重复]
【发布时间】:2014-11-12 09:27:32
【问题描述】:

我有一个名为 index.php 的文件,其中包含一些代码,它的目录地址是: http://www.example.com/user/index.php

我想在根目录中打开这个页面,让用户认为这是这样的索引页面: http://www.example.com/index.php

这样我的php文件地址是www.example.com而不是www.example.com/user

最简单的方法是什么?

【问题讨论】:

  • 我想你应该试试Url Rewriting
  • 谢谢。你能指导我这样做吗?

标签: php html directory


【解决方案1】:

这是由您的 Web 服务器处理的,而不是 PHP。检查给定 VirtualHost 定义的 DocumentRoot 的 Apache / IIS / etc 设置。

正如 SGT 所说,您也可以使用 URL 重写,但同样,这也是由 Web 服务器处理的,与 PHP 无关。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-12-13
    • 1970-01-01
    • 2014-06-18
    • 1970-01-01
    • 2020-09-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多