Title: Siteground Optimizer causing Javascript not to work
Last modified: September 17, 2021

---

# Siteground Optimizer causing Javascript not to work

 *  Resolved [syaho](https://wordpress.org/support/users/syaho/)
 * (@syaho)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/siteground-optimizer-causing-javascript-not-to-work/)
 *     ```
       # HTTPS forced by SG-Optimizer
       <IfModule mod_rewrite.c>
           RewriteEngine On
   
           RewriteCond %{HTTP:X-Forwarded-Proto} !https
           RewriteCond %{HTTPS} off
           RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
       </IfModule>
       # END HTTPS
       ```
   
 * This is the code that is in my .htaccess. The moment I remove these lines, my
   Javascript filter on my website starts working (again). When I add them back,
   Javascript is broken (GET function to filter results on my page).
 * Is there a workaround for this? Do I have to enable this within the plugin? Isn’t
   SSL alone enough?

Viewing 1 replies (of 1 total)

 *  Plugin Author [Hristo Pandjarov](https://wordpress.org/support/users/hristo-sg/)
 * (@hristo-sg)
 * SiteGround Representative
 * [4 years, 8 months ago](https://wordpress.org/support/topic/siteground-optimizer-causing-javascript-not-to-work/#post-14888080)
 * Make sure you’re enqueuing your scripts properly and through [https://](https://wordpress.org/support/topic/siteground-optimizer-causing-javascript-not-to-work/?output_format=md).
   You have insecure resources which fail to load, that’s why when SSL connection
   is forced your scripts fail to load.

Viewing 1 replies (of 1 total)

The topic ‘Siteground Optimizer causing Javascript not to work’ is closed to new
replies.

 * ![](https://ps.w.org/sg-cachepress/assets/icon-256x256.gif?rev=2971889)
 * [Speed Optimizer - The All-In-One Performance-Boosting Plugin](https://wordpress.org/plugins/sg-cachepress/)
 * [Support Threads](https://wordpress.org/support/plugin/sg-cachepress/)
 * [Active Topics](https://wordpress.org/support/plugin/sg-cachepress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/sg-cachepress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/sg-cachepress/reviews/)

## Tags

 * [javascript](https://wordpress.org/support/topic-tag/javascript/)
 * [php](https://wordpress.org/support/topic-tag/php/)

 * 1 reply
 * 2 participants
 * Last reply from: [Hristo Pandjarov](https://wordpress.org/support/users/hristo-sg/)
 * Last activity: [4 years, 8 months ago](https://wordpress.org/support/topic/siteground-optimizer-causing-javascript-not-to-work/#post-14888080)
 * Status: resolved