Forum Moderators: phranque
RewriteCond %{REQUEST_URI}!^/Public/
RewriteRule ^(.*)$ /Public/$1 [L]
Without the RewriteCond it will just spit back a 500. I understand what the condition rewrite dose but Im not sure why it has to be their for this to work, mabey some one could fill me in :)
In the .htaccess context, access-control processing will restart once any rewrite is invoked. The server will re-process the mod_alias, mod_proxy, mod_access, and mod_rewrite (and some other) directives in httpd.conf, conf.d, and in all the .htaccess files 'along the way' to the resource (file) specified by the new URL. This is to make sure that the new URL does not resolve to a file that needs password authorization or that has some other access restrictions on it. This makes mod_rewrite execution appear to be recursive, and causes loops if you don't explicitly prevent them. But since it also makes your server harder to hack, it's a good thing.
Jim