.htaccess - Site not detecting index -
i'm working on ubuntu 14.04.2 apache 2.4.7
i have virtual host set serve files /var/www/dev
, config file looks dev.conf
:
<virtualhost *:80> serveradmin ubuntu@12.234.567.89 documentroot /var/www/dev servername dev.site.com <directory /> options followsymlinks allowoverride </directory> <directory /var/www/dev/> options -indexes +followsymlinks allowoverride require granted </directory> </virtualhost>
i have number of files in /var/www/dev
directory don't want indexed hence -indexes
option
however have wordpress installation here , want files served browser properly. index file index.php
, located in /var/www/dev/
i have .htaccess file in same document root looks this:
directoryindex index.php index.html # begin wordpress <ifmodule mod_rewrite.c> rewriteengine on rewritebase / rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule . /index.php [l] redirectmatch 301 ^/terms-and-conditions\.php$ /terms-of-use redirectmatch 301 ^/privacy\.php$ /privacy-policy </ifmodule>
the directoryindex
should tell browser use index.php
file, getting 403 forbidden error.
i've tried:
- opening permissions, recursively changing ownership of
/var/www/dev
www-data:www-data
- adding
directoryindex index.php
dev.conf
file within<directory /var/www/dev/>
tag - above , below options item - checking
mod_dir
active (it is) - changing indexes option
+indexes
- when load site displays physical file index - refreshing browser when i'm given 403 or directory index load page correctly
- clearing browser cache every time test in browser
- looked in
apache2.conf
file , can confirm there no other referencedirectoryindex
- removing references directoryindex , changing option +indexes - makes work ok except users can see directory index folders including ones don't want them access
any appreciated!
edit: using chrome , firefox dev tools - if click option disable cache (when dev tools open) - site loads fine - perhaps clue
edit 2: error.log outputs line-
ah01276: cannot serve directory /var/www/dev/: no matching directoryindex (index.php,index.html) found, , server-generated directory index forbidden options directive
access.log shows browser details -
"get / http/1.1" 200 1462 "-" "mozilla/5.0 (windows nt 10.0; wow64; rv:41.0) gecko/20100101 firefox/41.0"
Comments
Post a Comment