0

I am trying to deploy our web app in google app engine. I would like to redirect any url ending with / to {url}/index.html e.g. /crm/features/ to be redirect to /crm/features/index.html. My app.yaml structure is specified below

runtime: php55
api_version: 1
#threadsafe: true


handlers:
- url: /
  static_files: static/index.html
  upload: static/index.html

# Serve php scripts.
- url: /mail/.*
  script: static/mail/mailsender_1.php
# index files
- url: /\w+/(\w+-*\w+)+/.*
  static_files: static/\w+/(\w+-*\w+)+/index.html
  upload: static/\w+/(\w+-*\w+)+/index.html
- url: /(.*)$
  static_files: static/\1
  upload: static/(.*)\.(js|css|png|jpg|jpeg|map|woff|ico|svg|woff2|ttf)
- url: /.*   #everything else after slash ends up here
  static_files: static/index.html
  upload: static/index.html

I am just struggling from last couple of hours.

Cool Coder
  • 309
  • 2
  • 11
  • 2
    You can't do that kind of redirect with app.yaml. You'll need to write code to do it. – new name Jul 07 '21 at 18:25
  • @gaefan thanks. We are using google app engine to deploy the app. Should I request to know if any script file I need to provide to handle the redirection. Its not actually a redirection but replace the url with url/index.html. I can very much achieve that by defining individual URLs like - url: /crm/features/ static_files: static/crm/features/index.html upload: static/crm/features/index.html – Cool Coder Jul 07 '21 at 18:42
  • Do you mean that you would like to append the `index.html ` to whatever URL that ends with the `/` character? – Farid Shumbar Jul 08 '21 at 08:01
  • @FaridShumbar Yes, only if it ends with / – Cool Coder Jul 08 '21 at 10:51

0 Answers0