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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T09:37:37+00:00 2026-05-30T09:37:37+00:00

On shared web-hosting my software supports multiple domains (all domains point to the same

  • 0

On shared web-hosting my software supports multiple domains (all domains point to the same public_html root directory). Each domain has it’s own gallery (in the gallery directory). Since multiple domains can not have their own resources (e.g. images) in the same directory for all sites I have root directories that match each HTTP host name. Here is what the directory structure looks like…

/public_html/

/public_html/.htaccess

/public_html/gallery/

/public_html/www.example1.com/gallery/topic_x/image.png

/public_html/www.example2.com/gallery/topic_y/image.jpg

/public_html/www.example3.com/gallery/topic_z/image.gif

A request to…

http://www.example1.com/gallery/topic_x/image.png

…needs to be rewritten to…

/public_html/www.example1.com/gallery/topic_x/image.png

This needs to be done using the .htaccess file as is noted above, there are no .htaccess files in the HTTP Host matching directories (/public_html/www.example1.com/.htaccess does not exist).

I have been trying with numerous modifications of the following…

RewriteEngine on
RewriteCond %{ENV:REDIRECT_STATUS} !200
RewriteRule ^(gallery)(/.+\.(gif|jpg|png))$ %{HTTP_HOST}$1$2 [L,NC]

…without success.

  • 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-30T09:37:38+00:00Added an answer on May 30, 2026 at 9:37 am

    This one works for me:

    RewriteRule ^(gallery/.+\.(gif|jpg|jpeg|png))$ /%{HTTP_HOST}/$1 [L,NC]
    

    If you want — you can add extra check to rewrite only if such final image is present (although I have not tested this):

    RewriteCond {%DOCUMENT_ROOT}/%{HTTP_HOST}/$1 -f
    RewriteRule ^(gallery/.+\.(gif|jpg|jpeg|png))$ /%{HTTP_HOST}/$1 [L,NC]
    

    But even your pattern should work (at least it passes the test) — maybe .htaccess is not enabled .. or you forgot to activate rewrite engine (RewriteEngine On)?

    I would also recommend adding this line before (or after) activating engine:

    Options +FollowSymLinks
    

    or

    Options +SymLinksIfOwnerMatch
    

    Some shared hosting may only work with 2nd, for some 1st is enough.

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

Sidebar

Related Questions

On shared web-hosting my software supports multiple domains (all domains point to the same
Recently our Web hosting provider moved to a medium trust level for all shared
I have a mvc 3 web app, but my shared web hosting company supports
I am having a frequent problems with my web hosting (its shared) I am
I had enough from shared web hosting(sql server on shared web hosting is just
i just deployed my php/mogodb website (php part in a shared web hosting, and
I have installed a PHP application onto a shared hosting web server. I am
I am porting a large web application to a shared web hosting environment. The
I was curious if there is a shared hosting platform for asp.net web sites
I'm developing a game in PHP+Mysql that is hosted in a shared web hosting.

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.