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

I am working in PHP on a Linux server with MySQL. I have a
I am looking for open-source linux-based Comet server. Currently, looking at Hookbox - but
Some of the users of our Ruby on Rails app have complained that page
Recently one of our Tomcat servers started having trouble deploying WAR files. We have
This question is kind of related to our web application and it is bugging
I am using JBoss 5.1.0.GA on Red Hat Linux 4. We have only webservices
We're using vlad the deployer for deploying rails apps to production and test servers.
Have you heard of real ASP.NET applications that use Mono? What problems do they
We have a PHP app with a dynamic URL scheme which requires characters to
I have a scenario where one PHP process is writing a file about 3

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.