i've in ROOT folders root_public, root_about, root_maps

and i have to show it for this sample:

  • domain.com <- from _public
  • domain.com/about AND domain.com/about/ <- from _about
  • domain.com/maps AND domain.com/maps/ <- from _maps

but i'm not sure, things i is going to do with root_publicmaps .. it may be problem. just how i'm able to resolve this issue? because i want this structure. and just how i'm able to do that?

i'm using:

Options +FollowSymlinks
RewriteEngine on
RewriteRule ^(.*)$ _public/$1 [NC]

this to see from file _public but i'm not sure, how you can do subfolders!

thanks!

According to your question, I'm presuming you've got a directory structure that appears like:

/your/document/root/_public
/your/document/root/_about
/your/document/root/_maps

...in which the Apache DocumentRoot is /your/document/root.

The next works, though I am sure you will find neater solutions.

# add trailing slash to domain.com/about and domain.com/maps
RewriteRule ^/(about|maps)$ /$1/

# rewrite domain.com/about/something to /_about/something
RewriteRule ^/(about|maps)/(.*) /_$1/$2

# rewrite anything that doesn't start about/ or maps/ to _public
RewriteCond %{REQUEST_URI} !^/(about|maps)/
RewriteRule ^/(.*) /_public/$1