Set $WORDCHARS accordingly. In your case, remove / from $WORDCHARS.
https://unix.stackexchange.com/a/726014
For the bash people
stty werase undef bind '"\C-w": backward-kill-word'