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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T19:38:44+00:00 2026-05-14T19:38:44+00:00

I have a VirtualHost block that includes common configuration items, one directive is ProxyPreserveHost.

  • 0

I have a VirtualHost block that includes common configuration items, one directive is ProxyPreserveHost.

Can I “procedurally” turn off ProxyPreserveHost for a Rewrite directive then have the include turn it back on? For example:

<VirtualHost *:80>
ServerName www.blah.com
...
...
ProxyPreserveHost off
RewriteRule /somepath http://otherhost/otherpath [P]

Include /path/to/file/turning-on-ProxyPreserveHost

</VirtualHost>

The otherhost is on a CDN and preserving the host is creating some name resolution issue that is not allowing the proxying of content in the host namespace.

ProxyReserveHost is only allowed in a Server Config or VirtualHost. It doesn’t look like I can selectively turn it off for the ProxyPass and ProxyPassReverse directives (encapsulated in the proxy flag of mod_rewrite).

  • 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-14T19:38:44+00:00Added an answer on May 14, 2026 at 7:38 pm

    The following, found on the internet, addressed my dilemma. As an aside, there is an open feature request to make ProxyPreserveHost configurable at the Location and Directory level within the Apache HTTPD project.

    <IfModule mod_headers.c>
      <Proxy "http://${build.replace.host}/">
        RequestHeader set Host ${build.replace.external.host}
      </Proxy>
      RewriteRule      ^/proxypath/ http://${build.replace.external.host}/path/to/resource.html [P]
      ProxyPassReverse /proxypath/ http://${build.replace.external.host}/path/to/resource.html
    </IfModule>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following virtual host configuration <VirtualHost petyo.net:443> ServerAdmin m@petyo.net DocumentRoot /home/ren/public/ <Directory
I have a big apache configuration file and in each of the virtualhost sections,
I added the following virtualhost (i have the default *:80 one of course) to
I have a one project being hosted in Apache under a specific subdomain: <VirtualHost
I have a controller Partners that I want to server off of http://partners.example.com Is
Here's what I have: <VirtualHost 127.0.0.1> DocumentRoot D:\XAMPP\xampp\htdocs\mysites\tupega.com ServerName tupega.tld <IfModule mod_rewrite.c> RewriteEngine on
Have a SomeLib.pro file that contains: CONFIG += debug TEMPLATE = lib TARGET =
Have a matrix report now that has Position, Hours and Wages for a location
I have a fairly simple redirect rule setup in my Apache vhost . <VirtualHost
I have a subdomain (called subdomain.mydomain.com) I just want that a page (ex: www.mydomain.com/page1.php)

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.