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

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

Enable autocomplete or intellisense in Atom editor for PHP -