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
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
Put these rules in the htaccess file in your document root:
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.