admin管理员组文章数量:1335887
I need to setup bedrock wordpress boilerplate in a sub-directory and get accessed through a reverse proxy setup. Please see below the setup as per my REQUIREMENTS:
Main Domain
/
Blog URL
/ -> Reverse Proxy to the below WP installation
Reverse proxy setup in apache server.
ProxyPass /blog/ /
ProxyPassReverse /blog/ /
Wordpress Installation (Bedrock)
/
Wordpress Project Root
/path/to/blog.domain/wp
Document root in Nginx
root /path/to/blog.dmain/wp/web;
Physical directory (blog) under web
/path/to/blog.dmain/wp/web/blog;
Created the below symlinks in the above folder (blog)
ln -s ../wp/ wp
ln -s ../app/ app
ln -s ../wp-config.php wp-config.php
ln -s ../index.php index.php
.env file
WP_HOME=
WP_SITEURL=/
wp_options table
siteurl ->
home ->
With the above setup, the below URLs work fine. /
Blog homepage works fine and loads all the theme assets from /
REST API works fine
/ Able to login in the WP admin and create/edit pages and posts without any issues.
However, other than the blog home page, rest of the pages and posts do not work and getting redirected as shown below, when accessed through the main domain (www.domain)
->
->
Note the leading slash of the page-slug/permalink is removed and redirected as /blogpage-x or /bloghello-world and resulting 404 error in the main domain.
I have deactivated yoast seo plugin.
Not sure what I am missing. Should I change any of my bedrock configs?
Please help. Thanks in advance,
Regards, Srini
I need to setup bedrock wordpress boilerplate in a sub-directory and get accessed through a reverse proxy setup. Please see below the setup as per my REQUIREMENTS:
Main Domain
https://www.domain/
Blog URL
https://www.domain/blog/ -> Reverse Proxy to the below WP installation
Reverse proxy setup in apache server.
ProxyPass /blog/ https://blog.domain/blog/
ProxyPassReverse /blog/ https://blog.domain/blog/
Wordpress Installation (Bedrock)
https://blog.domain/blog/
Wordpress Project Root
/path/to/blog.domain/wp
Document root in Nginx
root /path/to/blog.dmain/wp/web;
Physical directory (blog) under web
/path/to/blog.dmain/wp/web/blog;
Created the below symlinks in the above folder (blog)
ln -s ../wp/ wp
ln -s ../app/ app
ln -s ../wp-config.php wp-config.php
ln -s ../index.php index.php
.env file
WP_HOME=https://blog.domain/blog
WP_SITEURL=https://blog.domain/blog/wp/
wp_options table
siteurl -> https://blog.domain/blog/wp
home -> https://blog.domain/blog/wp
With the above setup, the below URLs work fine. https://www.domain/blog/
Blog homepage works fine and loads all the theme assets from https://blog.domain/blog/
https://www.domain/blog/wp-json/wp/v2/posts REST API works fine
https://blog.domain/blog/wp/wp-admin/ Able to login in the WP admin and create/edit pages and posts without any issues.
However, other than the blog home page, rest of the pages and posts do not work and getting redirected as shown below, when accessed through the main domain (www.domain)
https://www.domain/blog/page-x -> https://www.domain/blogpage-x
https://www.domain/blog/hello-world -> https://www.domain/bloghello-world
Note the leading slash of the page-slug/permalink is removed and redirected as /blogpage-x or /bloghello-world and resulting 404 error in the main domain.
I have deactivated yoast seo plugin.
Not sure what I am missing. Should I change any of my bedrock configs?
Please help. Thanks in advance,
Regards, Srini
Share Improve this question asked May 27, 2020 at 19:35 SriniSrini 11 Answer
Reset to default 0By disabling canonical redirection, the issue solved
remove_action('template_redirect', 'redirect_canonical');
Thanks to Mahesh Waghmare.
https://maheshwaghmare/avoid-wordpress-canonical-redirection/
本文标签: deploymentBedrock Boilerplate under a subdirectory and access through a reverse proxy setup
版权声明:本文标题:deployment - Bedrock Boilerplate under a sub-directory and access through a reverse proxy setup 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742394393a2466628.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论