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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T13:38:51+00:00 2026-06-13T13:38:51+00:00

When users go to foo.com/bar they should see the site located in foo.com/bar/public. The

  • 0

When users go to foo.com/bar they should see the site located in foo.com/bar/public. The public part has to be hidden. How can I achieve this using .htaccess?

Thanks in advance

  • 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-06-13T13:38:52+00:00Added an answer on June 13, 2026 at 1:38 pm

    Put these rules in the htaccess file in your document root:

    RewriteEngine On
    RewriteCond %{REQUEST_URI} ^/bar/(.*)$
    RewriteCond %{DOCUMENT_ROOT}/bar/public/%1 -f [OR]
    RewriteCond %{DOCUMENT_ROOT}/bar/public/%1 -d
    RewriteRule ^/?bar/(.*)$ /bar/public/$1 [L]
    

    The first condition checks that the URI starts with “/bar”, then groups the rest of the request. The next 2 conditions checks that the rest of the request (backreferenced by %1) maps to either an existing file or directory. If all conditions are met, then it rewrites the URI internally into /bar/public.

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

Sidebar

Related Questions

I have two ASP.NET pages: site.com/foo/bar.aspx that should be world accessible and site.com/foo/baz.aspx that
Lets suppose that I have some pages some.web/articles/details/5 some.web/users/info/bob some.web/foo/bar/7 that can call a
Suppose we have two separate github users: Foo and Bar. They own Quux and
I have two parts to a site, foo.domain.com and bar.domain.com (with bar.domain.com really being
I have a many-to-one relationship that users can edit via checkboxes. PK of Foo
Here are some various Python packages my company foo.com uses: com.foo.bar.web com.foo.bar.lib com.foo.zig.web com.foo.zig.lib
Situation: I have an ArrayList<String> containing a bunch of links to images (http:/www.foo.com/bar/image1.jpg, http:/www.foo.com/bar/image2.png,...
I have two sites say foo.com and bar.com and are both Django based. Primary
I have a website on foo.com serving PageA . PageA has some JQuery within
Suppose I have a page, http://foo.com/bar . Is it possible to use the Graph

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.