Some websites, no matter what page you're on, always just show their domain name in the address bar and nothing else. And many show the folders, e.g. http://superuser.com/questions/ask, but don't show the actual file, which would be like http://domain.tld/folder/file.extension. How are both accomplished? Thanks.
| ||||
|
feedback
|
|
This is because of a bit of a misconception with what a URL actually is, probably helped by the days of static .HTML files and PHP scripts. Traditionally, everything past the TLD is a pointer to a specific file. Say a blog post is located at That is why web servers (such as Apache) and programming languages (such as PHP) invented URL rewriting. What that does is converts the said URL into something a bit more manageable, such as Another approach just scraps all this entirely. Everything past the TLD (in this case,
This would most commonly be placed in a file by itself. I a common layout might be:
1Please keep in mind that I have no idea how the controller works for ASP MVC (I am more of a Django guy), so this probably isnt that accurate. It is just an example | |||||||||||
feedback
|
|
The file is a default as defined in the web servers config, or it's using URL re-writing (the folder path might not even exist). | |||||||||
feedback
|
|
What I was really looking for, is this: Just create a directory, have index.php/html inside the folder, and links to that directory won't show the file. Thanks for the other things too. | |||||
feedback
|