【问题标题】:What is the file that the websile loads when access?websile 访问时加载的文件是什么?
【发布时间】:2018-10-22 19:50:00
【问题描述】:

我正在尝试解决公司网站中的一些问题,但我不知道网站的主文件在哪里。 在 public_html 文件夹内没有 index.html 文件(或任何其他 .html),只有一个 index.php(我将在下面显示)和很多文件夹。我想对主网站 index.html(或网站在您访问时加载的 .html)做一个简单的更改。我怎样才能找到它?

这是 index.php:

<?php

/**
 * Laravel - A PHP Framework For Web Artisans
 *
 * @package  Laravel
 * @author   Taylor Otwell <taylor@laravel.com>
 */

$uri = urldecode(
    parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)
);

// This file allows us to emulate Apache's "mod_rewrite" functionality from the
// built-in PHP web server. This provides a convenient way to test a Laravel
// application without having installed a "real" web server software here.
if ($uri !== '/' && file_exists(__DIR__.'/public'.$uri)) {
    return false;
}

require_once __DIR__.'/public/index.php';

【问题讨论】:

  • 如果你没有使用 laravel 的经验,你可以阅读关于这个框架的文档。
  • 好像没有index.html。该 PHP 文件是入口点。如果您不了解它并想编辑该站点,那么您将不得不(至少)学习 PHP 的基础知识。
  • 很可能没有index.html文件,现在的网站是动态创建的,它们不是由静态html文件组成的。
  • 这是您要检查的下一个文件。 require_once __DIR__.'/public/index.php';。通常在 MVC 框架上运行的 php 项目的所有请求都通过public/index.php 编组
  • 这取决于您要进行的更改,以了解您需要更改哪个文件。在那之前你需要学习laravel

标签: php html


【解决方案1】:

如果你使用的是 laravel 版本 const VERSION = '5.4.36';然后就可以拿到主文件了

public_html/routes/web.php

Route::get('/', function () {
return view('welcome');

});

检查 / 调用到哪里

【讨论】:

    【解决方案2】:

    Laravel 在 public 文件夹中有它的索引:public/index.php

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-01-24
      • 1970-01-01
      • 1970-01-01
      • 2020-04-26
      • 1970-01-01
      • 2015-01-31
      • 1970-01-01
      • 2019-04-28
      相关资源
      最近更新 更多