Changing URL in openwrt

Do anyone know how to change this url
When i log into my openwrt router it takes me to this url
https://192.168.1.1/cgi-bin/luci
I want to change this url to
https://192.168.1.1/home

The short answer is, you can't.

The medium answer is, you can define symlinks, vhosts and similar, but in many cases the in-page links will push you back to the normal calling conventions.

The long answer, you can do whatever you manage to do, the source is open and only your abilities are the limit. Don't expect a point-and-click solution though.

If you install uhttpd-mod-ucode, you can "mount" LuCI elsewhere, e.g.

opkg update
opkg install uhttpd-mod-ucode
uci add_list uhttpd.main.ucode_prefix="/home=/usr/share/ucode/luci/uhttpd.uc"
uci commit uhttpd
service uhttpd reload

To disallow access to the old path, delete the CGI executable in /www/cgi-bin:

rm /www/cgi-bin/luci

To fix the initial redirect, modify the static index.html and clear your browser cache:

sed -i -e 's#cgi-bin/luci/#home/#g' /www/index.html

To restore the default behavior, copy the original files back from rom and delete the ucode setting:

cp /rom/www/index.html /www/index.html
cp /rom/www/cgi-bin/luci /www/cgi-bin/luci
uci del uhttpd.main.ucode_prefix
uci commit uhttpd
service uhttpd reload

This should work as expected for LuCI and it's official apps, but there might be 3rd party ones that assume a hardcoded /cgi-bin/luci prefix somewhere.

3 Likes

tried but it gave me this error

Not Found

The requested URL /home/ was not found on this server.