apache - htaccess - make public directory accessible -
yes, has been asked here lot, none of solutions provided worked me.
folder structure
/ +-- _projects | +-- includes | | |-- main.class.php | +-- scripts | | |-- saveitems.php | +-- view | | |-- layout.php | |-- index.php | |-- .htaccess | +-- _pub | +-- img | | |-- webicon_facebook.png | | |-- webicon_twitter.png | +-- view +-- includes |-- index.php |-- .htaccess
.htaccess file in root:
options -indexes +followsymlinks rewriteengine on rewritebase / rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^([a-z]+)\/(.+)$ index.php?page=$1&item=$2 [l,qsa] rewriterule ^([a-z]+)$ index.php?page=$1 [l,qsa]
the mission: enable browsers access folder or file in _pub
what i've tried:
- using .htaccess file
satisfy any
allow all
in _pub - disabling rewriteengine inside _pub folder
- change root htaccess file include
rewriterule ^_pub/$ _pub/ [l]
right belowrewritebase \
the curious thing when browsing _projects index file within folder accessed , website loads perfectly. when accessing _pub (without index file) 403 error host.
i'm pretty sure i'm missing in root htaccess file allow direct access folders , files in _pub, can't figure out what.
keep root .htaccess this:
options +indexes +followsymlinks rewriteengine on rewritebase / rewritecond %{request_uri} ^/_pub/ [nc,or] rewritecond %{request_filename} -f [or] rewritecond %{request_filename} -d rewriterule ^ - [l] rewriterule ^([a-z]+)/(.+)$ index.php?page=$1&item=$2 [l,qsa] rewriterule ^([a-z]+)/?$ index.php?page=$1 [l,qsa]
Comments
Post a Comment