Title: Problem with js and css &#8211; 403 Error
Last modified: September 1, 2016

---

# Problem with js and css – 403 Error

 *  Resolved [Angelo Rocha](https://wordpress.org/support/users/angelorocha/)
 * (@angelorocha)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/problem-with-js-and-css-403-error/)
 * I’m using CMB2 2.2.2.1 and wordpress 4.6 in a new project, and i have a problem
   with permissions in cmb2 css and js.
 * Error in console:
    [https://s18.postimg.io/422cjvis9/error.png](https://s18.postimg.io/422cjvis9/error.png)
 * [https://wordpress.org/plugins/cmb2/](https://wordpress.org/plugins/cmb2/)

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

 *  Plugin Contributor [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * (@tw2113)
 * The BenchPresser
 * [9 years, 8 months ago](https://wordpress.org/support/topic/problem-with-js-and-css-403-error/#post-7713645)
 * Looks like it’s not so much a permissions issue but more a mixture of url path
   and server path. Notice in the tooltip that it hits a “C:/Ampps…” path.
 * Can you read over this, [https://github.com/WebDevStudios/CMB2/wiki/Troubleshooting#cmb2-urls-issues](https://github.com/WebDevStudios/CMB2/wiki/Troubleshooting#cmb2-urls-issues),
   and the two GitHub issues referenced below it, to confirm if these are similar
   cases for yourself?
 * Found this comment in the CMB2 source code, which I believe the link above refers
   to:
 *     ```
       * Defines the url which is used to load local resources.
        * This may need to be filtered for local Window installations.
        * If resources do not load, please check the wiki for details.
       ```
   
 *  Thread Starter [Angelo Rocha](https://wordpress.org/support/users/angelorocha/)
 * (@angelorocha)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/problem-with-js-and-css-403-error/#post-7713651)
 * Problem solved:
 *     ```
       function update_cmb2_meta_box_url( $url ) {
       	return get_template_directory_uri().'/lib/cmb2' ;
       } add_filter( 'cmb2_meta_box_url', 'update_cmb2_meta_box_url' );
       ```
   
 * Is correct?
    Can go to production as well?
 *  Plugin Author [Justin Sternberg](https://wordpress.org/support/users/jtsternberg/)
 * (@jtsternberg)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/problem-with-js-and-css-403-error/#post-7713655)
 * If you read the wiki section Michael linked to, you’ll see that it is far preferable
   to use `str_replace` vs overriding the URL directly. If you read that section,
   it will explain why.
 *     ```
       function update_cmb2_meta_box_url( $url ) {
           /*
            * If you use a symlink, the css/js urls may have an odd path stuck in the middle, like:
            * http://SITEURL/wp-content/plugins/Users/jt/Sites/CMB2/cmb2/js/cmb2.js?ver=X.X.X
            * Or something like that.
            *
            * INSTEAD of completely replacing the URL,
            * It is best to do a str_replace. This ensures you only change the url if it's
            * pointing to the broken resource. This ensures that if another version of CMB2
            * is loaded (i.e. in a 3rd part plugin), that their correct URL will load,
            * rather than forcing yours.
            */
   
           return str_replace( 'C:/Ampps/www/hypenews/wp-content/', 'wp-content/', $url );
       }
       add_filter( 'cmb2_meta_box_url', 'update_cmb2_meta_box_url' );
       ```
   
 *  Thread Starter [Angelo Rocha](https://wordpress.org/support/users/angelorocha/)
 * (@angelorocha)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/problem-with-js-and-css-403-error/#post-7713801)
 * Hi Justin, i read, but is complicated for me but my english is very bad, the 
   problem is solved, thanks for your reply.

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

The topic ‘Problem with js and css – 403 Error’ is closed to new replies.

 * ![](https://ps.w.org/cmb2/assets/icon.svg?rev=2866672)
 * [CMB2](https://wordpress.org/plugins/cmb2/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/cmb2/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/cmb2/)
 * [Active Topics](https://wordpress.org/support/plugin/cmb2/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/cmb2/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/cmb2/reviews/)

## Tags

 * ["js error"](https://wordpress.org/support/topic-tag/js-error/)
 * [CSS error](https://wordpress.org/support/topic-tag/css-error/)

 * 4 replies
 * 3 participants
 * Last reply from: [Angelo Rocha](https://wordpress.org/support/users/angelorocha/)
 * Last activity: [9 years, 8 months ago](https://wordpress.org/support/topic/problem-with-js-and-css-403-error/#post-7713801)
 * Status: resolved