Title: less css w/ multisite
Last modified: August 20, 2016

---

# less css w/ multisite

 *  [Timjwp](https://wordpress.org/support/users/timjwp/)
 * (@timjwp)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/less-css-w-multisite/)
 * I’m not sure if this is a multisite problem or a theme problem but I only experience
   the problem with this theme on multisite installs.
 * The theme is wordpress bootstrap from 320press.
 * When load the less css files I am seeing an XMLHttpRequest error.
 * You can see the error at [http://tracesofviolet.com](http://tracesofviolet.com)
   in your browser console.
 * TIA,
    Tim J

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

 *  [Chris Olbekson](https://wordpress.org/support/users/c3mdigital/)
 * (@c3mdigital)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/less-css-w-multisite/#post-3059982)
 * > XMLHttpRequest cannot load [http://mainarray.com/uzsources/themes/wordpress-bootstrap/less/bootstrap.less](http://mainarray.com/uzsources/themes/wordpress-bootstrap/less/bootstrap.less).
   > Origin [http://tracesofviolet.com](http://tracesofviolet.com) is not allowed
   > by Access-Control-Allow-Origin.
   >  Uncaught Error: NETWORK_ERR: XMLHttpRequest
   > Exception 101 less-1.3.0.min.js:8 Failed to load resource: the server responded
   > with a status of 403 (Forbidden) [http://mainarray.com/?dm=d464f9a576471eb6022ae43976fb42b5&action=load&blogid=3&siteid=1&t=2028029890&back=http%3A%2F%2Ftracesofviolet.com%2F](http://mainarray.com/?dm=d464f9a576471eb6022ae43976fb42b5&action=load&blogid=3&siteid=1&t=2028029890&back=http%3A%2F%2Ftracesofviolet.com%2F)
 * It looks like the errors are mainly [Access Control Allow Origin](http://stackoverflow.com/questions/1653308/access-control-allow-origin-multiple-origin-domains)
   because the theme is pulling the .less files from the mainarray.com domain.
 * The theme is using [get_template_directory_uri()](http://codex.wordpress.org/Function_Reference/get_template_directory_uri).
   To load the stylesheets which should return the current sites domain as the base
   but they are loading from the mainarray.com domain. Also to note the wp-content
   directory has been changed to uzsources. Are you following the [Codex guidelines for moving wp-content](http://codex.wordpress.org/Editing_wp-config.php#Moving_wp-content)?
 * You can fix this by adding the following line to your virtual host file
 * `Header add Access-Control-Allow-Origin "http://mainarray.com"`
    `Header add 
   Access-Control-Allow-Origin "http://tracesofviolet.com"`
 * The root of the problem is the wrong domain being called from get_template_directory_uri.
 *  Thread Starter [Timjwp](https://wordpress.org/support/users/timjwp/)
 * (@timjwp)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/less-css-w-multisite/#post-3060013)
 * Thanks for the response Chris.
 * I’m not sure you are correct. All css and js files are loaded within the theme
   using get_template_directory_uri() but only the less file is throwing an error.
   I think it has something to do with how less is generated.
 * > The theme is using get_template_directory_uri(). To load the stylesheets which
   > should return the current sites domain as the base but they are loading from
   > the mainarray.com domain.
 * As stated this is multisite install. My other sites and themes on this install
   load styles, images etc. from mainarray.com (the domain which WordPress MU is
   installed on) without error.
 * > Also to note the wp-content directory has been changed to uzsources. Are you
   > following the Codex guidelines for moving wp-content?
 * The content directory was renamed using the Better WP Security plugin which has
   never been a problem before and again, if it were the cause, I would be seeing
   the error on other sites on the network. However, before I came here I did disable
   all my plugins just in case.
 * > You can fix this by adding the following line to your virtual host file
   > Header add Access-Control-Allow-Origin “[http://mainarray.com&#8221](http://mainarray.com&#8221);
   > 
   > Header add Access-Control-Allow-Origin “[http://tracesofviolet.com&#8221](http://tracesofviolet.com&#8221);
 * Shouldn’t this be avoided for security?
 * Thanks
 *  [Chris Olbekson](https://wordpress.org/support/users/c3mdigital/)
 * (@c3mdigital)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/less-css-w-multisite/#post-3060057)
 * Did a little research on the way the less.js parses the .less files. It is using
   a XMLHttpRequest which basically requires that the files are loaded from the 
   same domain name or “Origin” as the site they are loaded on.
 * As the Header add Access-Control-Allow-Origin doesn’t work you have 2 options.
   The first is to hard code the less files in the themes header.php
 *     ```
       <link rel="stylesheet/less" type="text/css" href="http://tracesofviolet.com /uzsources/themes/wordpress-bootstrap/less/bootstrap.less">
        <link rel="stylesheet/less" type="text/css" href="http://tracesofviolet.com /uzsources/themes/wordpress-bootstrap/less/responsive.less">
       ```
   
 * > As stated this is multisite install. My other sites and themes on this install
   > load styles, images etc. from mainarray.com (the domain which WordPress MU 
   > is installed on) without error.
 * This is fine for CSS, javascript and other static files but won’t work for the.
   less files.
 * The file requests should come from the same domain. You can fix this by going
   to your network admin sites menu under the site settings tab and add [http://tracesofviolet.com/](http://tracesofviolet.com/)
   as the Siteurl.

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

The topic ‘less css w/ multisite’ is closed to new replies.

## Tags

 * [less css](https://wordpress.org/support/topic-tag/less-css/)
 * [multisite](https://wordpress.org/support/topic-tag/multisite/)
 * [wordpress bootstrap](https://wordpress.org/support/topic-tag/wordpress-bootstrap/)

 * In: [Networking WordPress](https://wordpress.org/support/forum/multisite/)
 * 3 replies
 * 2 participants
 * Last reply from: [Chris Olbekson](https://wordpress.org/support/users/c3mdigital/)
 * Last activity: [13 years, 7 months ago](https://wordpress.org/support/topic/less-css-w-multisite/#post-3060057)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
