php - nginx code to redirect www.homepage.com/index.html to www.homepage.com?
问题描述
NGINX index.html homepage redirect is needed, which will:
redirect:
https://homepage.co.uk/index.html
to:
(without causing an infinite loop)
location = /index.html { return 301 homepage.co.uk/$1; }
UPDATED (Working Solution):
location /index.html {
if ($request_uri = /index.html) {
rewrite ^ http://$host? permanent;
}
}
解决方案
推荐阅读
- angular - 为什么在进行 AOT 构建时不能在导出中使用简单的数组方法
- python - 目标重启后pydbus重新连接
- python - 如何在 Python Pandas 中将值从一行结转到另一行,我正在尝试复制 SAS 保留语句的功能
- deployment - 在自动缩放条件下重新部署时,Kubernetes 滚动更新不遵守“maxUnavailable”副本
- r - 有一个需要为每个人选择最新的月份列表
- reactjs - 为什么代理在与 webpack 一起使用时不起作用
- java - 从 Firestore 查询数据到 Arraylist 但一无所获?
- ios - 没有使用滑块调用accessibilityIncrement 和accessibilityDecrement
- angular - 如何在 iOS Nativescript 中获取 SSID(网络名称)
- javascript - 没有 JQuery 的 VueJS 中的弹出菜单?