regex - how to configure htaccess file if main controller resides in public folder -
i saw near identical question mine, accepted answer doesn't work reason.
my problem cannot access index.php sits inside public folder. have tried innumerable combinations , believe it's in correct folder -- public folder.
the answer didn't work make rewritebase %{document_root}/public. did index of. @ least public folder not visible, however, feels i'm getting close.
any appreciated.
ps. can see application on local machine rewritebase /projectname/public url must include public or index of page. want rid of public portion , work off root (domain name).
here .htaccess file:
options -multiviews rewriteengine on rewritebase %{document_root}/public rewritecond %{request_filename} !-d rewritecond %{request_filename} !-f rewriterule ^(.+)$ index.php?url=$1 [qsa,l]
updated htaccess file:
options +followsymlinks -multiviews rewriteengine on rewritebase /public/ rewritecond %{request_filename} !-d rewritecond %{request_filename} !-f rewriterule ^(.+)$ index.php?url=$1 [qsa,l]
rewritebase
supposed relative path documentroot
not full path.
here 2 .htaccess need use:
root/.htaccess:
rewriteengine on rewriterule .* public/$0 [l]
public/.htaccess:
directoryindex index.php options +followsymlinks -multiviews rewriteengine on rewritebase /public/ rewriterule ^index\.php$ - [l,nc] rewritecond %{request_filename} !-d rewritecond %{request_filename} !-f rewriterule .* index.php?url=$0 [qsa,l]
Comments
Post a Comment