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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T01:55:25+00:00 2026-05-15T01:55:25+00:00

Our Linux server with Apache 2.x, Plesk 8.x hosts a number of e-commerce websites.

  • 0

Our Linux server with Apache 2.x, Plesk 8.x hosts a number of e-commerce websites. To take advantage of browser caching we would like to use Google’s provided copy of jquery.js.

Hence in the vhost.conf file of each we can use the following RewriteRule

RewriteCond %{REQUEST_FILENAME} jquery.min.js [nc]
RewriteRule . http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js [L]

And in vhost_ssl.conf

RewriteCond %{REQUEST_FILENAME} jquery.min.js [nc]
RewriteRule . https://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js [L]

OK now these rules work fine in the individual vhost.conf files of each domain. However we host over 200 domains, I would like for them to work but cannot seem to get them to work globally in the httpd.conf file.

Challenges are the following:

  1. Get the rewriterule to work in httpd.conf
  2. Detect if HTTPS is on, and if it is and the is is a secure page, rewrite to …
  3. Each individual domain will still have it’s own custom mod-rewrite rules. Which rules take precedence – global or per-domain? Do they combine? Is it ok if I have the “RewriteEngine On” directive in the global httpd.conf and then again in the vhost.conf?

Please let me know what your guys’ suggestions are. Desperate for a solution to this problem.

  • 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-15T01:55:25+00:00Added an answer on May 15, 2026 at 1:55 am

    I agree with Gumbo, but here’s how you can do it:

    1.. Get the rewriterule to work in httpd.conf

    As is clearly stated in the manual:

    By default, mod_rewrite configuration settings from the main server context are not inherited by virtual hosts. To make the main server settings apply to virtual hosts, you must place the following directives in each section:

    RewriteEngine On
    RewriteOptions Inherit
    

     

    2.. Detect if HTTPS is on, and if it is and the is is a secure page, rewrite to …

    This can be done by looking at %{HTTP_HOST}:

    RewriteCond %{HTTPS} !=on
    RewriteRule /jquery\.min\.js$ https://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js [NC,R=permanent]
    
    RewriteCond %{HTTPS} =on
    RewriteRule /jquery\.min\.js$ http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js [NC,R=permanent]
    

    You should also escape the dots and teh RewriteCond you use is unnecessary; you can do it in the RewriteRule.

    3.. Each individual domain will still have it’s own custom mod-rewrite rules. Which rules take precedence – global or per-domain? Do they combine? Is it ok if I have the "RewriteEngine On" directive in the global httpd.conf and then again in the vhost.conf?

    It will be prepended to the virtual host’s mod_rewrite configuration.

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

Sidebar

Related Questions

How would you approach benchmarking the following XSL:T process. Testing environment: a Linux server
There is site http://abc.com (made in PHP, MySQL, Apache, Linux environment). Currently, MySQL on
We have around 250 identical linux server which runs a business critical web application
I want to port the server component of our application, written in Visual Studio
I saw that one of our tools uses a ConsoleAppender to System.err next to
I realize that this question is slightly server related and could be posted on
Recently and without any website code changes, a few of our dynamic PHP pages
We are getting the following error in our clustered QA environment. We run Weblogic
A client noticed that one of our java applets wasn't working anymore. However, we
I have been tasked with the job of creating a web based system to

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.