You need to fix the problem that is causing your pressure/temperature relief valve to actuate. They are explicitly forbidden to be connected directly to a drain, because you should be aware that they are operating, so you know there is a problem, and act on it. They should never normally operate.
The most typical problem is either lack of, or a failed, expansion tank, causing excess pressure when a lot of hot water is used, replaced with cold water, and the cold water is heated (and expands) while no water is used, so pressure rises to unacceptable levels.
That is easily solved by adding (or replacing, if failed) an expansion tank, which can be located anywhere on the cold water supply after the check valve, meter, or PRV (regulator - Pressure Reducing Valve) that acts as a check valve, so long as there is no check valve between the tank location and the water heater (which would be unusual other than at the water supply entrance point.)
An additional possibility if you have been ignoring the operation of the relief valve is that it may no longer seal properly due to mineral build-up and need to be replaced, but if you don't first solve the basic reason for it operating at all, simply replacing the valve will generally not solve your problem.
If your municipal supply pressure is high, another possibility is that you have a PRV but that is not working right so your overall pressure is too high, causing the relief valve to actuate. Or you don't have a PRV but you need to add one. Those are common enough reasons, but far less common than the expansion tank.