Reverse proxy application for wordpress blog

I was able to configure the reverse proxy of my heroku application with the following in config.ru

require ::File.expand_path('../config/environment', __FILE__) use Rack::ReverseProxy do reverse_proxy /^\/blog(.*)$/, 'http://blog.domain.com$1', opts={:preserve_host => true} end run Appname::Application 

This allows my heroku application to run on com.com and have domain.com/blog as the URL while the wordpress site is hosted by blog.domain.com. Great bye.

The wordpress site is correctly served when switching to the .com / blog domain, however, when I go to any deeper page, for example, a separate Wordpress message gives an error. I used permalinks with the date and name in the form URL: domian.com/blog/2012/07/a-great-blog-post - Worpress now doesn't seem to like it. When I switched the links back to the domain.com/blog/?p=4 form, the page was successfully served.

It does not seem to process or sort slashes after the correct domain.com/blog domain name. What I find strange is that domain.com/blog/wp-admin (and the whole WP admin application) works without any hiccups.

Can anyone see any glaring problems why pages / posts with a few slashes "/" can cause problems?

Thanks in advance!

+6
source share
1 answer

Well, I found a solution for some reason in the WP settings for a permalink; none of the default options liked it, except for the form where it can receive a message by id. (Http://www.domain.com/blog/?p=123)

For SEO purposes, I wanted the post title to be in the url. Therefore, I entered in the field of the user structure: /index.php/%postname%/

It seems to require that index.php for wordpress handle routing correctly.

+2
source

Source: https://habr.com/ru/post/919827/


All Articles