我对文档根有问题。实现index.html的唯一方法是指定http://mysite.com/index.html,是否有一种方法可以自动地将其重定向到带有http://mysite.com的index.html?
ServerAdmin webmaster@mysite.com DocumentRoot /var/www/mysite.com
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/mysite.com>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog /var/log/apache2/error.log
# Possible values include: debug, info, notice, warn, error, crit,发布于 2013-10-30 12:06:23
您需要将DirectoryIndex添加到主机配置中。这基本上告诉服务器,如果请求中没有指定文件,应该查找哪些文件。
在你的例子中,这是可行的:
<Directory /var/www/mysite.com>
DirectoryIndex index.html
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>https://stackoverflow.com/questions/19681635
复制相似问题