GoogleのApp Engineにいくつかの静的なウェブサイトを移動したばかりです。独自のドメインを使用する場合は、wwwサブドメインが必要です。両方のドメインは正しくルーティングされますが、リンクにwwwが入力または存在しない限り、完全なURLパスはサブドメインに渡されません。 wwwがなければ、ページは家にリダイレクトされます。Google App EngineのURLパスがwwwサブドメインで失われた
作業サイトのいずれかのリンクは動作します:
http://www.synth.tk/daw/
http://synth.tk/daw/
問題サイトのみの最初のリンクが動作します。第二は、ホームページにリダイレクトします。
http://www.carolyncaton.com/photos/
http://carolyncaton.com/photos/
両方のドメインは、Googleの指示に従って、次のホストレコードを使用してFreeDNSで設定されています
@ | A | 216.239.32.21
@ | A | 216.239.34.21
@ | A | 216.239.36.21
@ | A | 216.239.38.21
www | CNAME | ghs.google.com
そして両方が、次のapp.yaml
ファイルを使用しています:
application: app-name-here
version: 1
runtime: python
api_version: 1
default_expiration: "30d"
handlers:
- url: /(.*\.css)
mime_type: text/css
static_files: static/\1
upload: static/(.*\.css)
- url: /(.*\.html)
mime_type: text/html
static_files: static/\1
upload: static/(.*\.html)
expiration: "1h"
- url: /(.*\.js)
mime_type: text/javascript
static_files: static/\1
upload: static/(.*\.js)
- url: /(.*\.eot)
mime_type: application/vnd.ms-fontobject
static_files: static/\1
upload: static/(.*\.eot)
- url: /(.*\.(svg|svgz))
mime_type: images/svg+xml
static_files: static/\1
upload: static/(.*\.(svg|svgz))
- url: /(.*\.ttf)
mime_type: font/truetype
static_files: static/\1
upload: static/(.*\.ttf)
- url: /(.*\.woff)
mime_type: application/x-font-woff
static_files: static/\1
upload: static/(.*\.woff)
- url: /(.*\.pdf)
mime_type: application/pdf
static_files: static/\1
upload: static/(.*\.pdf)
# image files
- url: /(.*\.(bmp|gif|ico|jpeg|jpg|png))
static_files: static/\1
upload: static/(.*\.(bmp|gif|ico|jpeg|jpg|png))
# index files
- url: /(.+)/
static_files: static/\1/index.html
upload: static/(.+)/index.html
expiration: "15m"
- url: /(.+)
static_files: static/\1/index.html
upload: static/(.+)/index.html
expiration: "15m"
# site root
- url:/
static_files: static/index.html
upload: static/index.html
expiration: "15m"
あなたは私の投稿を完全に読まなかったかもしれないと思っています。もう一度見てください。問題は、wwwが正しく転送され、もう一方が完全なURLパスに失敗した理由です。 – Mica