Why can't I cd into a directory?
Solution 1:
You need execute permission to cd into a directory.
sudo chmod o+x /var/www
Solution 2:
There is some reason for prohibiting the ''others'' from entering the directory, no? So I would suggest to get root access to enter that directory, do some stuff, and leave it, dropping the sudo shell.
sudo -i
cd /var/www
# do your thing
cd -
exit