我有一个网站,比如说 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/