• Resolved Ikaryas

    (@ikaryas)


    Hello

    I’m currently testing my multisite locally and stumbled across the following problem;

    I have a main site on which the multisite is enabled (multisite.dev) and one sub-site; test.multisite.dev

    I added the domain mapping to point to test.dev
    No problems so far. Except that stylesheets/fonts (more specifically Font Awesome) aren’t loaded (Font from origin ‘http://test.multisite.dev’ has been blocked from loading by Cross-Origin Resource Sharing policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘http://test.dev’ is therefore not allowed access.)

    I’ve tried the .htaccess Header set Access-Control-Allow-Origin “*” but to no avail. I know it’s the problem with the redirect because when I disable ‘primary’, and thus get redirected to test.multisite.dev, it works.

    Kind regards

    https://ww.wp.xz.cn/plugins/wordpress-mu-domain-mapping/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Ron Rennick

    (@wpmuguru)

    If you set the mapped domain as the primary domain then your stylesheets should use that domain for the URL.

    Thread Starter Ikaryas

    (@ikaryas)

    I’m sorry but I forgot to mention that it’s the CSS of plugins that isn’t loaded… Should I contact the plugin creator(s) for that or is there a fix for this?
    The CSS of the theme itself loads without any problems.

    Plugin Author Ron Rennick

    (@wpmuguru)

    If the plugins are enqueuing the CSS using the standard hooks then what I said above would apply.

    Thread Starter Ikaryas

    (@ikaryas)

    Really weird but the Header set Access-Control is working now (haven’t changed a thing :s ), but only on the live version;

    <FilesMatch ".(eot|ttf|otf|woff)">
    	Header set Access-Control-Allow-Origin "*"
    </FilesMatch>

    When using plugins_url() to generate the path to load css from a plugin (using wp_enqueue_style) it still generates a path based on the multisite url and not the mapped domain (for me). Which is causing the font being loaded from the plugin to be blocked.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Domain Mapping & CORS errors’ is closed to new replies.