user2491321
user2491321

Reputation: 673

app.yaml cannot call my css file for my index.php

I have create an app in php. The folder "myapp-test-1" has a file called index.php and a folder CSS which includes the file main.css which is the css file for index.php .I am trying to create my app yaml file in order to upload my project in google's app engine. This is my app.yaml file:

application: myapp-test-1  
version: 1
runtime: php
api_version: 1

handlers:

- url: /.*
  script: index.php

- url: /css
  static_dir: css

- url: /css/
  script: main.css

when test it in browser it seems that index.php file is not full loaded. Moreover the css for index.php is not working.

Upvotes: 0

Views: 2129

Answers (2)

BrockLee
BrockLee

Reputation: 981

You need to have the

- url: /.*
  script: index.php

last, because if you have it first, the order in which GAE will read this file is this, then the other two css ones. The regex .* next to url says that all URLs will lead to index.php, so putting this last will allow GAE to read the css ones first. You also don't need to include

- url: /css/
  script: main.css

if you're only going to load the css files in your index.php.

So overall, it should look like

application: myapp-test-1  
version: 1
runtime: php
api_version: 1

handlers:

- url: /css
  static_dir: css

- url: /.*
  script: index.php

Upvotes: 6

Mamba
Mamba

Reputation: 61

I believe that you should try to leave only :
- url: /.*
script: path/index.php

and remove the two references to the css.

from inside the index.php, make sure that you call your css file using the right path. eventually if you use firefox, the function "inspect element" and the console, will tell you why your file is not loaded...

good luck

Upvotes: 0

Related Questions