不可能有多个别名吗?
Is it impossible to have more than one alias?
我正在 Windows 10 上配置 httpd
,一切正常 - 除了我无法为同一个 VirtualHost
配置多个别名这一事实。
我的extra/httpd-vhosts.conf
文件(变量配置在httpd.conf
):
<VirtualHost *:80>
# Define Server Defaults
ServerAdmin "${SERVER_ADMIN}"
ServerName "${SERVER_NAME}"
ServerAlias "www.${SERVER_NAME}"
# Define public_html Directory
DocumentRoot "${PUBLIC_HTML}"
# Define Log Paths
ErrorLog "${ROOTDIR}/logs/${SERVER_NAME}-error.log"
CustomLog "${ROOTDIR}/logs/${SERVER_NAME}-access.log" common
# Create phpMyAdmin alias
Alias "/phpmyadmin" "${PMA}"
<Directory "${PMA}">
Require local
</Directory>
# Create an alias for old `public_html` directories
Alias "/archive" "${ROOTDIR}/archive/"
<Directory "${ROOTDIR}/archive/">
Require all granted
</Directory>
</VirtualHost>
当我检查 httpd -t
时,我收到 Syntax OK
,并且我可以访问 http:///localhost/phpmyadmin/,
但是我无法访问 http:///localhost/archive/.
截图:
phpMyAdmin 没问题,但是:
/archive
没有。
为什么?
谢谢你的帮助,请原谅我的英语不好。
问题已解决:是的!我只需要:
Options Indexes FollowSymLinks Multiviews
里面 <Directory ...></Directory>
.
代码:
<Directory "${ROOTDIR}/archive">
Options Indexes FollowSymLinks Multiviews
Require all granted
</Directory>
我正在 Windows 10 上配置 httpd
,一切正常 - 除了我无法为同一个 VirtualHost
配置多个别名这一事实。
我的extra/httpd-vhosts.conf
文件(变量配置在httpd.conf
):
<VirtualHost *:80>
# Define Server Defaults
ServerAdmin "${SERVER_ADMIN}"
ServerName "${SERVER_NAME}"
ServerAlias "www.${SERVER_NAME}"
# Define public_html Directory
DocumentRoot "${PUBLIC_HTML}"
# Define Log Paths
ErrorLog "${ROOTDIR}/logs/${SERVER_NAME}-error.log"
CustomLog "${ROOTDIR}/logs/${SERVER_NAME}-access.log" common
# Create phpMyAdmin alias
Alias "/phpmyadmin" "${PMA}"
<Directory "${PMA}">
Require local
</Directory>
# Create an alias for old `public_html` directories
Alias "/archive" "${ROOTDIR}/archive/"
<Directory "${ROOTDIR}/archive/">
Require all granted
</Directory>
</VirtualHost>
当我检查 httpd -t
时,我收到 Syntax OK
,并且我可以访问 http:///localhost/phpmyadmin/,
但是我无法访问 http:///localhost/archive/.
截图:
phpMyAdmin 没问题,但是:
/archive
没有。
为什么?
谢谢你的帮助,请原谅我的英语不好。
问题已解决:是的!我只需要:
Options Indexes FollowSymLinks Multiviews
里面 <Directory ...></Directory>
.
代码:
<Directory "${ROOTDIR}/archive">
Options Indexes FollowSymLinks Multiviews
Require all granted
</Directory>