openwrt 中 uhttpd 自动跳转到 /cgi-bin/luci

时间:2022-04-15 23:08:47

在uhttpd站点根目录“/www“下,使用了index.html来进行跳转:


该文件为:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="refresh" content="0; URL=/cgi-bin/luci" />
</head>
<body style="background-color: black">
<a style="color: white; text-decoration: none" href="/cgi-bin/luci">LuCI - Lua Configuration Interface</a>
</body>
</html>


可以看到它使用了<meta>标签来实现跳转


在初始配置,并更改uhttpd端口后,其它web服务使用80口之后,如果主页下没有默认文件(出现404)时,浏览器会使用缓存,清空浏览器缓存后可解决此问题。