Bug with Generic Mirror CDN custom files plugin URL rewriting
-
Hi Frederick,
I noticed a small problem when using a generic mirror CDN setup along with a custom content directory. To be fair it’s not really a bug, just a glitch with my weird setup.
The setup is like this:
content |--themes |--plugins wordpress |--wp-includes |--wp-admin |--... etc...
So the wordpress install is in a subfolder on the same level as the new content directory.
In
Cdn.php
when you’re creating the regexes for custom you are adding the site path so in my case it only matchesexample.com/wordpress/content/plugins...
You can fix by changing lines 310-312 like so:
$regexps[] = '~(["\'(])\s*((' . $domain_url_regexp . ')?((?:' . w3_preg_quote($site_path) . '|/)(' . implode('|', $mask_regexps) . ')))~i'; if ($site_domain_url_regexp) $regexps[] = '~(["\'(])\s*((' . $site_domain_url_regexp . ')?((?:' . w3_preg_quote($site_path) . '|/)(' . implode('|', $mask_regexps) . ')))~i';
Just allows the site path to be ignored in this kind of setup.
- The topic ‘Bug with Generic Mirror CDN custom files plugin URL rewriting’ is closed to new replies.