Rewrite question


Let say that i have a website stored in /public_html/subfolder/
.htaccess is stored in /public_html

when user type (in browser), he should be redirected to /public_html/subfolder/index.html
however user should only see in browser address bar and not

this i solved using:

RewriteBase /

#Rewrites to
RewriteCond %{REQUEST_URI} !^/subfolder
RewriteRule ^(.*)$ subfolder/$1 [L]

this works…
now, let say that website allow admin login using /public_html/subfolder/admin/
i would like to display only and not as it is now:

therefore i was thinking to add to previous code:

#Rewrites to
RewriteCond %{REQUEST_URI} !^/subfolder/admin/
RewriteRule ^(.*)$ subfolder/admin/$1 [L]

but this does not work.
Any idea where is my mistake ?

Your first rewrite rule should take care of that already. I did a quick test on my local machine to be sure.

Partially it does, but it does not rewrite it well as i have
and i would like to have

When I used your rewrite rule on my local machine, it did exactly that. If it isn’t working for you, then there must be something else significant in your htaccess that we haven’t seen.