Www. won't work however non-www works fine

Hello, I was wondering if someone could help me out.
For some reason my only office won’t work on www. however non-www works fine.
If I change the Document Editing Service address to www. it works fine but then non-www won’t work is there any way to work around this?
I was also wondering why pivot tables ain’t working anyone willing to help out?
I’m using Debian 10 with Nextcloud 19.0.2