我来自 CodeIgniter,其中文件/文件夹通常以这种方式受到保护:
.php 文件
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
index.html 文件
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>
我想可以使用 .htaccess 或硬方式,但是,如何使用 Laravel 4 来完成?有没有办法使用它的“标准”?
编辑:是为共享主机构建的项目。
/assets/{css, img, js}
/packages
/system/{app, bootstrap, vendor, index.php, .htaccess, favicon.ico}