使用 htaccess 更改默认网页

发布于 2024-12-27 05:24:29 字数 276 浏览 2 评论 0原文

这是我的网站的文件结构

  • app/view/home.php
  • .index.php
  • .htaccess

现在,如果访问 index.php,我想将服务器重定向到 app/view/home.php 。

通过访问 http://localhost/,app/view/home.php 必须是要提供服务的页面。

谢谢!

This is the file structure of my website

  • app/view/home.php
  • .index.php
  • .htaccess

Now, I want to redirect the server to app/view/home.php if index.php is accessed.

By going to http://localhost/, the app/view/home.php must be the page to be served.

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

冬天旳寂寞 2025-01-03 05:24:29

也许这个在 htaccess 中?

redirect 301 / http://localhost/app/view/home.php

maybe this in htaccess?

redirect 301 / http://localhost/app/view/home.php
兮颜 2025-01-03 05:24:29

我认为这可以通过别名指令来实现

Alias / /physical/path/to/file/apps/view/home.php

I think this can be achieved by alias directive

Alias / /physical/path/to/file/apps/view/home.php
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文