Closed vmanthos closed 4 months ago
Related - https://secure.helpscout.net/conversation/1805696754/329611/
$host
is pointing to a totally different name.
Related - https://secure.helpscout.net/conversation/1717861502/312768/ Any progress on this one?
This is not something that can be implemented soon. We might reopen this in the future.
Before submitting an issue please check that you’ve completed the following steps:
3.10.5.1
Describe the bug
In cases where the
HTTP_HOST
is different from the site's URL, as that's returned byhome_url()
, caching and optimizations do not work because WP Rocket's configuration file cannot be found here: https://github.com/wp-media/wp-rocket/blob/7efe5e0c685884f99cf54e6fc6b178a1a98fc256/inc/classes/Buffer/class-tests.php#L195-L202This is because the file path/filename of the configuration file we are looking for is different compared to the one we store the configuration file: https://github.com/wp-media/wp-rocket/blob/7efe5e0c685884f99cf54e6fc6b178a1a98fc256/inc/functions/files.php#L163-L177
In the
class-tests.php
we rely onHTTP_HOST
: https://github.com/wp-media/wp-rocket/blob/7efe5e0c685884f99cf54e6fc6b178a1a98fc256/inc/classes/Buffer/class-config.php#L194while when creating the configuration on
home_url()
.WPEngine Example
Per @DahmaniAdame WPEngine doesn't allow subfolder WordPress installation.
This results in
HTTP_HOST ≠ home_url()
.To Reproduce
Although I haven't tried this, using WPEngine's example, i.e. creating a subfolder installation and redirecting that to a subdomain, should allow reproducing this: How To Redirect Subfolder To Subdomain
Expected behavior
Currently, after figuring this is the issue, the solution we have is to use the config cloner helper plugin.
Caching/optimizations should work automatically even when
HTTP_HOST
is different from the site's URL.Additional context
We should use the same approach both in the configuration file's creation, and when checking for it in the
Buffer
class.According to @Tabrisrp:
Slack convo: https://wp-media.slack.com/archives/C43T1AYMQ/p1639636868049600 Ticket: https://secure.helpscout.net/conversation/1717861502/312768/
Backlog Grooming (for WP Media dev team use only)