apache2 alias index.html到另一个目录
我在服务器中有两个目录apache2 alias index.html到另一个目录,apache,mod-rewrite,mod-alias,Apache,Mod Rewrite,Mod Alias,我在服务器中有两个目录 /var/www/html/new-website/ /var/www/html/old-website/ 旧网站有index.html文件,而新网站没有此文件。它还有一个/blog目录 我想将请求指向根/和/index.html指向旧网站目录,并将所有其他请求指向新网站 我的配置是 <VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /var/ww
/var/www/html/new-website/
/var/www/html/old-website/
旧网站
有index.html
文件,而新网站
没有此文件。它还有一个/blog
目录
我想将请求指向根/
和/index.html
指向旧网站
目录,并将所有其他请求指向新网站
我的配置是
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/new-website/
ServerName website.example.io
Alias "/index.html" "/var/www/html/old-website"
Alias "/blog" "/var/www/html/old-website/blog"
<Directory /var/www/html/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
服务器管理员webmaster@localhost
DocumentRoot/var/www/html/new网站/
ServerName.example.io
别名“/index.html”“/var/www/html/old-website”
别名“/blog”“/var/www/html/old-website/blog”
选项索引跟随符号链接
允许超越所有
要求所有授权
ErrorLog${APACHE_LOG_DIR}/error.LOG
CustomLog${APACHE\u LOG\u DIR}/access.LOG组合
除以下端点外,所有其他端点都正常工作
/
的请求被重定向到index.html/
index.html/
的请求正在加载适当的内容,但URL中添加了一个后续的/
index.html/
,并将其视为根请求/
?