With this datapack, server operators can use the simple configuration command to enable or disable the nether or the end separately.
When the nether is disabled, the gamerule allow_entering_nether_using_portals will be set to false, preventing anyone from traveling there, and giving a message that says the nether is disabled if someone touches a portal block. Any player already in the nether, when it gets disabled, or who gets there through some way other than a nether portal, will be sent to their spawn point (unless their spawn point is in the nether) and shown a message that says the nether is disabled.
Unlike nether portals, end portals can't be disabled simply with a gamerule, when a player enters the end portal while the end is disabled, they will be sent to their spawn point and shown a message that says the end is disabled.
Currently has no support for disabling dimensions aside from the nether or the end.
To open the configuration, run the command /function lock_dimensions:config with operator permissions.
If you notice any bugs or have constructive feedback, please let me know.