Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Why is showing the file extension a bad thing? Why do you care if you see ".php"?


It’s a good question.

It is best practice to have well-thought-out URLs that do not have extensions. The reasons include:

- If your site’s back-end technology changes, all those URLs will either break, or need redirected, or be specially handled with have extra cruft forever.

- It takes longer to type and is harder to remember.

- It makes your technology obvious instead of receding into the background.

- It limits your ability to make awesome URLs, because now your URLs are dictated by how you name and organize your server-side scripts. (URLs are a user interface, just like GUIs, though they don’t get as much attention! http://alanhogan.com/url-as-ui)

- There is no benefit to outweigh the above negatives.


These are excellent points. A few of them I would have a small bit of disagreement over the perceived negativity, but they are too small to bother with. I would say it's more like there is not enough benefit to outweigh the perceived, possible, and/or actual negatives. But that seems a silly statement to make in of itself.

I think it revolves what your website actually is and how deeply invested you are in your URLs.


These are definitely a hacker's complaints. Your daughter's piano teacher won't give a shit, and he'll love that it's free.


Perhaps, but that doesn’t make it the right choice.




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

Search: