Title: minify causing incorrect source urls
Last modified: January 13, 2023

---

# minify causing incorrect source urls

 *  Resolved [finnsk3](https://wordpress.org/support/users/finnsk3/)
 * (@finnsk3)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/minify-causing-incorrect-source-urls/)
 * Hi all,
 * Just installed WP-Optimize and enabled minification but this is how css/js is
   being added:
 *     ```wp-block-code
       <link rel="stylesheet" id="wpo_min-header-0-css" href="https://wp-content/cache/wpo-minify/1673572879/assets/wpo-minify-header-cb0d6789.min.css" type="text/css" media="all">
       ```
   
 * Obviously this isn’t going to work. I had a look through the settings but couldn’t
   find anyway to fix this. I assume it’s trying to put the site URL in there but
   failing.
   Any ideas?
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fminify-causing-incorrect-source-urls%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Support [vupdraft](https://wordpress.org/support/users/vupdraft/)
 * (@vupdraft)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/minify-causing-incorrect-source-urls/#post-16371865)
 * Under Minify >> CSS , have you got the option to  Enable merging of CSS files?
 * Under Minify>> Java Script, have you got the option to  Enable merging of JavaScript
   files checked?
 *  Thread Starter [finnsk3](https://wordpress.org/support/users/finnsk3/)
 * (@finnsk3)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/minify-causing-incorrect-source-urls/#post-16373905)
 * It doesn’t work wether it is enabled or disabeld.
   With out merging enabled:
 *     ```wp-block-code
       <link rel='stylesheet' id='wpo_min-header-0-css' href='https://wp-content/cache/wpo-minify/1673751005/assets/wpo-minify-header-c830677b.min.css' type='text/css' media='all' />
       ```
   
 * I had a look through the PHP in the plugin and worked it out though. WP-Optimize
   is using WP_CONTENT_URL (line 39 – class-wp-optimize-minify.php).
   WP_CONTENT_URL
   =
 *     ```wp-block-code
       define( 'WP_CONTENT_URL', get_option( 'siteurl' ) . '/wp-content' );
       ```
   
 * I am using an azure hosted wordpress instance and it has some weird settings 
   in wp_config by default including siteurl:
 *     ```wp-block-code
       define('WP_SITEURL', 'http://'. filter_input(INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_STRING));
       ```
   
 * INPUT_SERVER isn’t defined at all by default and I am not sure if this is something
   that can be done in the azure portal as I don’t work in infastructure I don’t
   have visilibity of it. That being said hardcoded ‘[http://&#8217](http://&#8217);
   in the definition of WP_SITEURL sounds very wrong and after doing a google search
   it looks like people have ran in to this issue [https://arlanblogs.alvarnet.com/change-http-to-https-in-azure-hosted-wordpress-website-when-option-grayed-out/](https://arlanblogs.alvarnet.com/change-http-to-https-in-azure-hosted-wordpress-website-when-option-grayed-out/)
 * I just removed the definition for WP_HOME and WP_SITEURL so that I could edit
   these settings within the WP dashboard which fixed the issue. Luckily I have 
   write access to wp_admin.php.
   It’s an issue that only happens to people using
   azure app services but it could be fixed by not including WP_CONTENT_URL when
   defining WPO_CACHE_MIN_FILES_URL if WP_CONTENT_URL is incorrect.
 * Thanks.
    -  This reply was modified 3 years, 4 months ago by [finnsk3](https://wordpress.org/support/users/finnsk3/).
 *  Plugin Support [vupdraft](https://wordpress.org/support/users/vupdraft/)
 * (@vupdraft)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/minify-causing-incorrect-source-urls/#post-16379245)
 * Hi,
 * Thank you for sharing your resolution, it really is very helpful. I have passed
   your comments onto our development team

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

The topic ‘minify causing incorrect source urls’ is closed to new replies.

 * ![](https://ps.w.org/wp-optimize/assets/icon-256x256.png?rev=1552899)
 * [WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance](https://wordpress.org/plugins/wp-optimize/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-optimize/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-optimize/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-optimize/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-optimize/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-optimize/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [vupdraft](https://wordpress.org/support/users/vupdraft/)
 * Last activity: [3 years, 4 months ago](https://wordpress.org/support/topic/minify-causing-incorrect-source-urls/#post-16379245)
 * Status: resolved