我在Google App Engine上有一个wordpress网站。一切正常,但是,如果我尝试不带斜杠访问/ wp-admin /,则将加载仪表板,但链接将为404。
进入仪表板时,我需要手动添加斜杠。由于这是GAE,因此我不确定如何解决此问题。
示例:
我访问mysite.com/wp-admin
侧边栏上的链接将为mysite.com/edit-post.php(404)
如果我添加斜杠并访问仪表板mysite.com/wp-admin /
链接现在为mysite.com/wp-admin/edit-post.php,效果很好。
在管理员状态下,我需要使用它来强制使用斜杠。我以前从未遇到过这个问题。
这是我的app.yaml
runtime: php
env: flex
handlers:
- url: /(.*\.(htm|html|css|js))$
static_files: wordpress/\1
upload: wordpress/.*\.(htm|html|css|js)$
application_readable: true
- url: /wp-content/(.*\.(ico|jpg|jpeg|png|gif|woff|ttf|otf|eot|svg))$
static_files: wordpress/wp-content/\1
upload: wordpress/wp-content/.*\.(ico|jpg|jpeg|png|gif|woff|ttf|otf|eot|svg)$
application_readable: true
- url: /(.*\.(ico|jpg|jpeg|png|gif|woff|ttf|otf|eot|svg))$
static_files: wordpress/\1
upload: wordpress/.*\.(ico|jpg|jpeg|png|gif|woff|ttf|otf|eot|svg)$
application_readable: true
- url: /wp-includes/images/media/(.*\.(ico|jpg|jpeg|png|gif|woff|ttf|otf|eot|svg))$
static_files: wordpress/wp-includes/images/media/\1
upload: wordpress/wp-includes/images/media/.*\.(ico|jpg|jpeg|png|gif|woff|ttf|otf|eot|svg)$
application_readable: true
- url: /wp-admin/(.+)
script: wordpress/wp-admin/\1
secure: always
- url: /wp-admin/
script: wordpress/wp-admin/index.php
secure: always
- url: /wp-login.php
script: wordpress/wp-login.php
secure: always
- url: /wp-cron.php
script: wordpress/wp-cron.php
login: admin
- url: /xmlrpc.php
script: wordpress/xmlrpc.php
- url: /wp-(.+).php
script: wordpress/wp-\1.php
- url: /(.+)?/?
script: wordpress/index.php
beta_settings:
cloud_sql_instances: PROJECT:us-central1:match
runtime_config:
document_root: wordpress
skip_lockdown_document_root: true
env_variables:
WHITELIST_FUNCTIONS: escapeshellarg,escapeshellcmd,exec,pclose,popen,shell_exec,phpversion,php_uname
我不确定是否应该包含另一个文件。