答案1
首先,您的代码中有一个拼写错误。 应该是。AllowOvveride
AllowOverride
以下是其他一些提示:
Alias /nytest /var/www/nytest # this directive will make the directory accessible at http://localgost/nytest in case that your DocumentRoot is not '/var/www/' but '/var/www/html/' as it is by default
<Directory /var/www/nytest>
Options +Indexes
IndexOptions FancyIndexing FoldersFirst NameWidth=* DescriptionWidth=* # better appearance
DirectoryIndex Disabled # disable the 'execution' of the index files
AllowOverride None # disable .htaccess files
AddType text/plain .html .htm .shtml .php .phtml .php5 # display these file types as plain text
php_admin_flag engine off # don't run arbitrary PHP code; if you've other scripting languages, disable them too.
Order allow,deny
Allow from all
Require all granted
</Directory>