从任何子文件夹重定向到根索引.html



任何作为子文件夹放置的东西,它都会读取 domain.com/index.html

与此类似,但在 Nginx 中 将 URL 不存在的子文件夹重定向到根目录

server {
listen 80;
listen [::]:80;
server_name example.com;
root /apt/website/path;
index index.html;
location / {
try_files $uri $uri/ /index.html;
}
}

相关内容

最新更新