Hacker News new | past | comments | ask | show | jobs | submit login

It depends how it is implemented. After extracting the ID and looking up the post you can then check that the "slug" matches. Return a 404 if it doesn't.

This may add a bit of complexity (if the slug data is mutable you need to allow any past versions or freeze it in creation) but isn't too hard if this is the approach that you want to take.




Ok, but we don't have to talk about this "depends" idea: that's not how reddit did it and I thought we were talking about reddit ;P.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: