gpt4 book ai didi

php - 我可以将 index.php 放在子目录中,但不在 url 中显示子目录吗?

转载 作者:行者123 更新时间:2023-12-02 07:42:52 25 4
gpt4 key购买 nike

我有一个网站,比如说 http://mysite.com .我想将 index.php 放在子目录 public_html/mysubdir/index.php 中。我希望 public_html/mysubdir/index.php 在用户转到 http://mysite.com 时执行.我希望 url 继续阅读 http://mysite.com。这可能吗?

最佳答案

如果您的网络服务器是 Apache,您可以使用 URL rewriting with mod_rewrite .

另一种选择是在根目录中创建一个 index.php,并在子目录中包含 index.php。

关于php - 我可以将 index.php 放在子目录中,但不在 url 中显示子目录吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9267168/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com