Вопрос

How can I set up yaml file for app engine to do the following. Im using php on google app engine

When you access the following url

for example domain.com/index.php

it shows on the url box domain.com/index.html or domain.com/index

Это было полезно?

Решение

I think that what you want to do is to have a php file called index.php that serves your content and a URL that's separate from that.

In App Engine, you actually don't need to do anything special to achieve that effect. When you're going through the App Engine tutorial (https://developers.google.com/appengine/docs/php/gettingstarted/helloworld), you'll notice that the app.yaml file lets you configure which URLs are mapped to which files. In that example, all URLs are mapped to helloworld.php:

handlers:
- url: /.*
  script: helloworld.php

But you could also make it so that a specific URL map to a specific php file. For your example of routing domain.com/index to index.php:

handlers:
- url: /index
  script: index.php

Другие советы

To change the "url box" requires a redirect. You don't do that I the yaml file, but in the handler.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top