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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T19:37:16+00:00 2026-05-29T19:37:16+00:00

My software supports multiple domain names all pointed at the same directory on the

  • 0

My software supports multiple domain names all pointed at the same directory on the server (a different database for each of course). So these domains…

www.example1.com
www.example2.com
www.example3.com

…all point to…

/public_html/

In the image directory…

/public_html/images/

I have directories that exactly match the host names for each website:

/public_html/images/www.example1.com/
/public_html/images/www.example2.com/
/public_html/images/www.example3.com/

I’m trying to get Apache to rewrite requests so that if you view the image directly and look at the address bar you only see the host name once.

So a request for…

http://www.example1.com/images/book.png

…is fetched by Apache at…

/public_html/images/www.example1.com/book.png

One of the things I’ve tried and have had success with in different circumstances is the following though it doesn’t work in this situation:

RewriteRule ^[^/]*/images(.+) images/%{HTTP_HOST}/$1
  • 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-29T19:37:18+00:00Added an answer on May 29, 2026 at 7:37 pm

    Try adding the following to the .htaccess file in the root directory of your site (public_html)

    RewriteEngine on
    RewriteBase / 
    
    #prevent looping from internal redirects
    RewriteCond %{ENV:REDIRECT_STATUS} !200
    #only rewrite gif, jpg or png
    RewriteRule ^(images)(/.+\.(gif|jpg|png))$ $1/%{HTTP_HOST}$2 [L,NC] 
    

    Your rule

    RewriteRule ^[^/]*/images(.+) images/%{HTTP_HOST}/$1
    

    did not work because you have a leading / before images. In .htaccess the leading / is removed, so the rule would never match.

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

Sidebar

Related Questions

My software supports multiple domains pointed at the exact same directory, I use shared
On shared web-hosting my software supports multiple domains (all domains point to the same
On shared web-hosting my software supports multiple domains (all domains point to the same
Now, I'm doing a project, I would like to implement this software supports multiple
We have a Windows application that can use multiple PCI adapters. These adapters all
Our software must be able to run on SQL Server 2000 and 2005. To
Valve Software's Steam Server Query protocol as documented here allows you to query their
I write software for an IT consulting company that supports a number of clients
I have a BENQ projector that I need to control in software. It supports
I am working on an Java assignment for a software design course in my

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.