Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 839841
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T05:31:38+00:00 2026-05-15T05:31:38+00:00

When I minify jquery using YUI compressor, it works fine. When I then add

  • 0

When I minify jquery using YUI compressor, it works fine.
When I then add gzip compression (and serve this version via mod rewrite), the gzipped version throws this error:

illegal character in jquery.min.js on line 1

Line 1 is:

�������M�����������s�8�0�?�!sz�dKr�=�

This results in a “jquery is not defined” error.
I am using the following rewrite rules to serve up the gzipped versions:

#Check to see if browser can accept gzip files.
ReWriteCond %{HTTP:accept-encoding} (gzip.*)
#make sure there's no trailing .gz on the url
ReWriteCond %{REQUEST_FILENAME} !^.+\.gz$
#check to see if a .gz version of the file exists.
RewriteCond %{REQUEST_FILENAME}.gz -f
#All conditions met so add .gz to URL filename (invisibly)
RewriteRule ^(.+) $1.gz [L] 

I can’t find any references to this happening to anyone else.
Thoughts?

P.S. – it looks like this same question was asked on the jQuery forums in 2008. It has 278 views, but no answer: http://forum.jquery.com/topic/how-to-reference-jquery-1-2-6-min-js-when-zipped-with-gzip

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T05:31:39+00:00Added an answer on May 15, 2026 at 5:31 am

    If I had to guess, I would say Apache is already gzipping your JS file, and your rewrite leads to the request being doubly compressed.

    Remove the rewrite rules and take a look at the jQuery file in Firebug. You will see there whether it is already being served compressed.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have enabled google Minify in code igniter using this library on our website.
My site uses YUI Compressor to minify CSS and it's removing the space preceding
I'm merging (and afterwards minify with YUI compressor) my CSS and JS files. My
Should I minify/gzip my Jquery with my other scripts on my page, or use
I am trying to minify some files in a roll-up script using jsmin. This
This works fine: $('.mainRotatorPaginator a').click(function() { $(this).everyTime(1000, 'rotation', function(i) { $('.mainRotatorPaginator').css('outline', '1px solid green');
I'm using the yui-compressor plugin for maven and can't seem to get it to
I followed the PHP Minify instructions listed on this page to use a sub-directory,
I'm trying to minify multiple CSS files using preg_replace() . Actually, I'm only trying
My client is using W3TC with the minify html/xml and when I enable that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.