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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T19:39:33+00:00 2026-05-15T19:39:33+00:00

Apache mod_rewrite: explain me %{HTTP_HOST} expecially when using addon domains Situation (directories tree) on

  • 0

Apache mod_rewrite: explain me %{HTTP_HOST} expecially when using addon domains

Situation (directories tree) on an Apache server with addon domains:

main-domain.com/ 
| 
|_ .htaccess (just an empty file, no rule in here) 
|_ index.html (shown when accessing http://main-domain.com)
| 
|_ addon-domain-1.com/ 
|  | 
|  |_ .htaccess 
|  |_ index.html (shown when accessing http://addon-domain-1.com or http://main-domain.com/addon-domain-1.com/)
| 
|_ addon-domain-2.com/ 
   | 
   |_ .htaccess 
   |_ index.html (shown when accessing http://addon-domain-2.com or http://main-domain.com/addon-domain-2.com/)

Let’s say in “addon-domain-1.com/.htaccess” file I have some rule using %{HTTP_HOST} like:

RewriteCond %{HTTP_HOST} ^something$

Does %{HTTP_HOST} evaluates to the domain of the currently requested url on server???

So if asking for:

http://addon-domain-1.com/

%{HTTP_HOST} will be "addon-domain-1.com"?

http://addon-domain-1.com (without final slash)

%{HTTP_HOST} will still be "addon-domain-1.com"?

http://www.addon-domain-1.com

%{HTTP_HOST} will still be "www.addon-domain-1.com"?

And when asking for:

http://main-domain.com/addon-domain-1.com

%{HTTP_HOST} will be "main-domain.com"???
or "main-domain.com/addon-domain-1.com"???
  • 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-15T19:39:34+00:00Added an answer on May 15, 2026 at 7:39 pm

    You pretty much guessed them all right! The last one would be;

    main-domain.com
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can you explain how mod_rewrite works using this as an example: http://www.domain.com/page.php?q=keyword1,keyword2,keywordn&page=x&param=i => http://www.domain.com/page/keyword1,keyword2,keywordn?page=x&param=i
At the moment I'm using Apache's mod_rewrite to redirect all html requests to http(s)://www.domain.com/blah
I'm working on a new project, using Apache's mod_rewrite and PHP to get pretty
I have to use <base href=http://www.mysite.com/it//> on my site because I am using apache
I'm using apache's mod_rewrite to make my application's URL's pretty. I have the basics
Using Apache and mod_rewrite I can rewrite a complex request to a simple filename,
I'm using Apache's mod_rewrite to route requests for JPG files to a directory outside
I am developing a web application using PHP and I am using Apache's mod_rewrite
I've been using ISAPI_Rewrite from Helicon ( http://www.helicontech.com/isapi_rewrite/ ) on a Server 2003 box
I am using apache mod_rewrite, htaccess. I find a way to achieve images/css/js file

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.