yoonjesung
yoonjesung

Reputation: 1198

New version of google app engine produces 404 error (PHP 5.5)

I have a site running through google app engine on runtime environment php 5.5. I am trying to deploy a new version of the app (I do this by changing the version number in app.yaml, reference here: Configuring with app.yaml) and deploying the app.

My current site can be reached via www.my-app-name.appspot.com (which works fine) and I should be able to view my new app version at www.2-dot-my-app-name.appspot.com, however I get a 404 error when trying to view version 2.

Version 1 and version 2 of my app are identical, the only difference being that version 2 has "2" as the version in app.yaml. Did I miss a step here? Is there something I need to do as far as configuration goes to view version 2? (Note: I do not want to make version 2 live, I just want to deploy it and test it to see if some changes work before making it live).

Edit: I tried testing to see what routing all traffic to version 2 of my app would do. In this case, version 2 of the app works but version 1 does not. It looks like when all traffic is routed to a particular version, that version is served up with the url "myappname.appspot.com". Any other versions are served using the url "version-dot-myappname.appspot.com". Anyone know how I can configure my app so that these urls work?

Upvotes: 0

Views: 250

Answers (2)

yoonjesung
yoonjesung

Reputation: 1198

I discovered what the culprit was. I had a PHP configuration file that changed the header location to 'http://www.'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']. Though this type of configuration will work for your default app, it will not work when testing a new version because when testing a new version the routing cannot contain the leading 'www'. Hope this helps someone else down the line who encounters the same problem.

Note: If you use traffic splitting, users will not have any issues accessing your new version as long as your custom domain is mapped correctly.

Upvotes: 1

Dan Cornilescu
Dan Cornilescu

Reputation: 39824

According to the Routing via URL doc the address for your new app version should be 2-dot-my-app-name.appspot.com, without the leading www.:

https://version-dot-app-id.appspot.com
http://version.app-id.my-custom-domain.com
    Sends the request to an available instance of the given version of the default module.

Upvotes: 1

Related Questions