i made lots of alterations in my webapp and also the web addresses were really like that..

http://miwebapp.com/public/module/action

However i transformed your directory structure and also the public folder has become the webroot folder it's means that doesn't is available more.

now my web addresses examines

http://miwebapp.com/module/action

I wish to create a Apache Rewrite to trap the Web addresses that include the general public word..

Y do this..

RewriteEngine On 
RewriteCond %{REQUEST_FILENAME} -s [OR] 
RewriteCond %{REQUEST_FILENAME} -l [OR] 
RewriteCond %{REQUEST_FILENAME} -d 
RewriteRule ^.*$ - [NC,L] 
RewriteRule ^public/(.+)$ /$i [NC,L]
RewriteRule ^.*$ /index.php [NC,L]

:D Thanks :D

Drop the very first RewriteRule. All existing file (size not null + link) and all sorts of sites url are caught because of your RewriteCondition and also you place it to complete nothing and become the final rule ([L]). So everything experiences that only rule.

BTW: I am unsure if $i does is available, but we use to obtain $1 rather.

Edit 1:

Yap I first viewed it too! However I got the answer:

RewriteCond %{REQUEST_FILENAME} -s [OR] 
RewriteCond %{REQUEST_FILENAME} -l [OR] 
RewriteCond %{REQUEST_FILENAME} -d      
RewriteRule ^public/(.+)$ /$1 [NC,L]     

RewriteCond %{REQUEST_FILENAME} !-s     
RewriteCond %{REQUEST_FILENAME} !-l     
RewriteCond %{REQUEST_FILENAME} !-d     
RewriteRule ^.*$ /index.php [NC,L]      

this will avoid spinning all file to index.php in loops! (Observe that whenever you perform a redirect, the .htaccess is reprocessed using the new values, [L] just steer clear of the rewrite for that current request)