.htaccess: Transfer name to index.php if not directory public -


i have piece of code:

options followsymlinks <ifmodule mod_rewrite.c>     rewriteengine on      rewritecond %{request_filename} !-f     rewritecond %{request_filename} !-d     rewritecond %{request_filename} !-l     rewriterule ^(.*)$ index.php?url=$1 [l] </ifmodule>  <ifmodule !mod_rewrite.c>     errordocument 404 /index.php </ifmodule> 

i don't know how allow directory name "public" inside folder .htaccess, other names dir should transfered index.php. how that?

add rewritecond exclude public directory

rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewritecond %{request_filename} !-l rewritecond %{request_uri} ^/public(/.*)?$ rewriterule ^(.*)$ index.php?url=$1 [l] 

now, redirection work /public directories only. if want url have rest of path that's below public url=subfolder/page.php /public/subfolder/page.php use

rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewritecond %{request_filename} !-l rewriterule ^public/?(.*)$ index.php?url=$1 [l] 

Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -