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 327127
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T09:22:23+00:00 2026-05-12T09:22:23+00:00

Currently what I have in my .htaccess file is this, RewriteCond %{HTTP:Accept-encoding} gzip RewriteCond

  • 0

Currently what I have in my .htaccess file is this,

RewriteCond %{HTTP:Accept-encoding} gzip
RewriteCond %{REQUEST_FILENAME}.gz -f
RewriteRule ^(.*).(css|js)$ /$1.$2.gz

My CSS and Javascript files have a number next to them such as example01.css and whenever I update them, I increase the number. Each time I do, I also have to update my head.php file to include the new updated file in the page. I also add a “c” to a file when I compress it with YUI compressor. Then I compress it with 7-zip into gzip format because my server does not support deflate, even though it says it does.

My question is, how do I write my .htaccess file so that I give it example.css and it checks if example01.css exists, then checks example02.css, until it finds the latest one, then checks if example02c.css exist, and then finally example02.css.gz?

I’ve also considered using Minify but I forgot why I decided against it.

  • 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-12T09:22:23+00:00Added an answer on May 12, 2026 at 9:22 am

    htaccess has very limited abilities; there are no increment or decrement functions, and the only way to get a “loop” is through inefficient sets of redirects.

    You could try using a RewriteMap to call a script to do these checks for you instead.

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

Sidebar

Related Questions

I have a relatively complex .htaccess file to control page requests, this currently redirects
I currently have the modrewrite: RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ /index.php/$1 [L]
My current htaccess file looks like this: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f [NC] RewriteCond
My current .htaccess file contains the following lines: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule
I'm currently trying to have my 1and1 host an .htaccess file with mod_rewrite enabled,
I have the following conditions in my .htaccess file: RewriteEngine on RewriteCond %{HTTP_HOST} ^ex\.co$
I have an Apache .htaccess file in the parent directory to directory this .htaccess
I'm having some trouble setting up a htaccess file. Currently I have 15 domains
Here is the code I have currently in my .htaccess file: Options +FollowSymLinks RewriteEngine
I have a .htaccess file that looks like this: SetEnv APPLICATION_ENV development RewriteEngine On

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.