无法在 google 云应用程序中包含 js 和 css 文件
Cannot include js and css file in google cloud app
我正在使用 lamp 部署,使用云 sql。将我的项目上传到 xxx.appspot.com 后。所有 css 和 js 文件都没有打开。它抛出:
Error: Not Found The requested URL /public/js/admin/custom.js was not
found on this server.
我正在添加 css 文件,如下所示:
<link rel="stylesheet" href="http://syncspot-ds.appspot.com/public/css/admin/login.css">
<link rel="stylesheet" href="http://syncspot-ds.appspot.com/public/css/admin/bootstrap.css">
<link rel="stylesheet" href="http://syncspot-ds.appspot.com/public/css/admin/font-awesome.css">
我的app.yaml文件如下:
application: xxx
version: 1
runtime: php55
api_version: 1
threadsafe: true
handlers:
- url: /public/css/admin
static_dir: /public/css/admin
- url: /public/css/front
static_dir: /public/css/front
- url: /public/css/front/images
static_dir: /public/css/front/images
- url: /public/fonts
static_dir: /public/fonts
- url: /public/images
static_dir: /public/images
- url: /public/images/00-ICON LOGO
static_dir: /public/images/00-ICON LOGO
- url: /public/images/admin
static_dir: /public/images/admin
- url: /public/images/background
static_dir: /public/images/background
- url: /public/images/icons
static_dir: /public/images/icons
- url: /public/images/logo
static_dir: /public/images/logo
- url: /public/js/admin
static_dir: /public/js/admin
- url: /public/js/front
static_dir: /public/js/front
- url: /public/js/gmap
static_dir: /public/js/gmap
- url: /public/swf
static_dir: /public/swf
- url: /public/uploads/channel_content
static_dir: /public/uploads/channel_content
- url: /public/uploads/profile_img
static_dir: /public/uploads/profile_img
- url: /.*
script: index.php
我的 .htaccess 文件如下:
DirectoryIndex index.php
RewriteEngine on
RewriteCond !^(index\.php|public|robots\.txt|favicon\.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ ./index.php/ [L,QSA]
我正在使用 Code Igniter,AngularJS 和 MySql。如果我使用外部 css 说:
<link rel="stylesheet" href="http://1223.123.123.123/xxx/public/css/admin/login.css">
它工作正常。
请帮我制作一个link到css或js文件。
对于静态目录,documentation 在 static_dir 部分中没有前导“/”。
尝试使用这种格式:
- url: /public/css/admin
static_dir: public/css/admin
我正在使用 lamp 部署,使用云 sql。将我的项目上传到 xxx.appspot.com 后。所有 css 和 js 文件都没有打开。它抛出:
Error: Not Found The requested URL /public/js/admin/custom.js was not found on this server.
我正在添加 css 文件,如下所示:
<link rel="stylesheet" href="http://syncspot-ds.appspot.com/public/css/admin/login.css">
<link rel="stylesheet" href="http://syncspot-ds.appspot.com/public/css/admin/bootstrap.css">
<link rel="stylesheet" href="http://syncspot-ds.appspot.com/public/css/admin/font-awesome.css">
我的app.yaml文件如下:
application: xxx
version: 1
runtime: php55
api_version: 1
threadsafe: true
handlers:
- url: /public/css/admin
static_dir: /public/css/admin
- url: /public/css/front
static_dir: /public/css/front
- url: /public/css/front/images
static_dir: /public/css/front/images
- url: /public/fonts
static_dir: /public/fonts
- url: /public/images
static_dir: /public/images
- url: /public/images/00-ICON LOGO
static_dir: /public/images/00-ICON LOGO
- url: /public/images/admin
static_dir: /public/images/admin
- url: /public/images/background
static_dir: /public/images/background
- url: /public/images/icons
static_dir: /public/images/icons
- url: /public/images/logo
static_dir: /public/images/logo
- url: /public/js/admin
static_dir: /public/js/admin
- url: /public/js/front
static_dir: /public/js/front
- url: /public/js/gmap
static_dir: /public/js/gmap
- url: /public/swf
static_dir: /public/swf
- url: /public/uploads/channel_content
static_dir: /public/uploads/channel_content
- url: /public/uploads/profile_img
static_dir: /public/uploads/profile_img
- url: /.*
script: index.php
我的 .htaccess 文件如下:
DirectoryIndex index.php
RewriteEngine on
RewriteCond !^(index\.php|public|robots\.txt|favicon\.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ ./index.php/ [L,QSA]
我正在使用 Code Igniter,AngularJS 和 MySql。如果我使用外部 css 说:
<link rel="stylesheet" href="http://1223.123.123.123/xxx/public/css/admin/login.css">
它工作正常。
请帮我制作一个link到css或js文件。
对于静态目录,documentation 在 static_dir 部分中没有前导“/”。
尝试使用这种格式:
- url: /public/css/admin
static_dir: public/css/admin