Nevermind I figured out myself.
In case someone needs the solution:
You have to enter in Setings>Permalinks
Then in case you are using a custom structure select %postname% and it should work
I think using Post name structure should solve the problem too