Reputation: 36703
I have a module on Appengine say exmplemodule
And my dispatch.yaml
is
application: sampleappname
dispatch:
- url: "*/"
module: default
- url: "example.abc.com/*"
module: examplemodule
It is working fine, so when I try to access example.abc.com/index.php
it loads the index.php
file normally. But what I want is that when i should access example.abc.com
the index.php file should open.
How can i achieve this?
Ask me if this much of information is not sufficient to answer this question of mine.
Upvotes: 0
Views: 725
Reputation: 6893
The yaml
file for module examplemodule
needs to define a handler for /
that routes to index.php
Something like the following
handlers:
# Serve index.php for GET /
- url: /
script: index.php
Upvotes: 0
Reputation: 39824
Note: my answer comes from the python GAE, I suspect it may be applicable to php as well, but I'm not 100% certain.
I'm using a similar dispatch.yaml
, but with just the 2nd rule.
I just tested on my app that a request like example.abc.com
is sent to examplemodule and can be seen in the GAE logs for that module (it also started an instance for the module):
From this log it appears to me that example.abc.com
is actually expanded to 'example.abc.com/', which means it would be caught by your 1st rule.
First check your logs for both modules to see which one actually gets the request.
If indeed it goes to default I see a few things to try:
example.abc.com/
before the one for */
example.abc.com
in default) - I'd leave such rules for each module config separately, not the dispatcher file.Note: I also have the examplemodule's default handler treat an empty path request in the same manner as a request to the module's homepage to prevent a 404 (likely you need something different for php):
requested_path = self.request.path_info[1:]
if not requested_path:
requested_path = 'home.html'
Upvotes: 1