apache - How can I check whether file exists or not in specific folder in .htaccess? -
this code,
rewritecond %{document_root}application/public%{request_uri} -f [or] rewritecond %{document_root}application/public%{request_uri} -d rewriterule application/public/.* - [l]
but when entered localhost/css/style.css
404 page, although application/public/css/style.css
exists.
i think mean:
rewriteengine on rewritebase / rewriterule ^application/public/.* - [l] rewritecond %{document_root}/application/public%{request_uri} -f [or] rewritecond %{document_root}/application/public%{request_uri} -d rewriterule .* /application/public/$0 [l]
the first rewriterule prevent following rule being executed when url starts /application/public/
. prevent following rule being applied more once, although unlikely happen in specific case.
the second rule(-set) internally redirect request /application/public/
folder, if , if requested filename/directory exists in folder.
Comments
Post a Comment