.htaccess - Directory Listing at domain level (Apache) -
i have subdomain on apache 2.4 web server (an aws ec2 host), indexes set - it's not displaying index @ top level: in subdirectories. if there no directoryindex file (index.html) @ top level (http://stuff.example.com), displays amazon linux ami test page. if have index.html file @ top level, it's displayed normally.
i've tried find documentation indexes not displayed domain pages, , couldn't. therefore must missing in basic configuration (httpd.conf):
<directory "/data/stuff"> allowoverride indexes authconfig require granted </directory> <virtualhost *:80> servername stuff.example.com documentroot /data/stuff options +indexes +followsymlinks </virtualhost>
in aws ec2 configuration of apache 2.4 (at least), there additional config file /etc/httpd/conf.d/welcome.conf
:
<locationmatch "^/+$"> options -indexes errordocument 403 /.noindex.html </locationmatch> <directory /var/www/noindex> allowoverride none require granted </directory> alias /.noindex.html /var/www/noindex/index.html
not reveal nature of amazon linux ami test page, explains why page overrides directory listing root url of subdomain: since it's matched regular expression in locationmatch
.
this code meant display useful web site visitor if web admin hasn't added index page yet... yet has side effect of suppressing directory listings root url of subdomain. 1 solution comment out, or remove, options -indexes
directive /etc/httpd/conf.d/welcome.conf
.
Comments
Post a Comment