diff --git a/.htaccess b/.htaccess index ea56c24b..90dd11bc 100644 --- a/.htaccess +++ b/.htaccess @@ -4,3 +4,9 @@ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^.*$ index.php [L] + +# Protect .env file + + Order allow,deny + Deny from all + diff --git a/README.md b/README.md index bb6e0316..b55b96e4 100644 --- a/README.md +++ b/README.md @@ -74,8 +74,7 @@ $ bower install 使用 gulp 构建前端代码: ``` -$ gulp copy -$ gulp build +$ gulp copy && gulp build ``` 可以开始使用啦~ @@ -90,6 +89,12 @@ $ gulp build location / { try_files $uri $uri/ /index.php?$query_string; } + +# Protect .env file +location ~ /\.env +{ + deny all; +} ``` 现在你可以访问 `http://example.com/{ player_name }.json` 来得到你的首选 API(可在后台配置)的 JSON 用户数据。另外一个 API 的 JSON 数据可以通过访问 `http://example.com/(usm|csl)/{ player_name }.json` 得到。 diff --git a/web.config b/web.config index c4ae5fbd..6d0807b4 100644 --- a/web.config +++ b/web.config @@ -17,4 +17,13 @@ + + + + + + + + +