user1174762
user1174762

Reputation: 593

Understanding different website URLs

I am confused as to how, for example, this page is loaded. I am looking at the navigation bar in my browser and it says:

stackoverflow.com/questions/ask

I am used to seeing this for the pages I develop:

Example.com/ask.php

Why does their URL not contain page names or values? Or does it? If so, how.

Thanks.

Upvotes: 1

Views: 65

Answers (2)

Oliver Charlesworth
Oliver Charlesworth

Reputation: 272507

The URL does not have to correspond to an actual pathname in the local filesystem on the server, that's just convention.

Often, the URL will be rewritten.

Upvotes: 3

Madara's Ghost
Madara's Ghost

Reputation: 174957

This kinds of jobs are usually done with URL rewriting. Depending on your server, there are several ways of achieving it.

The most famous one is the mod_rewrite utilized in the .htaccess file Apache servers have.

Upvotes: 1

Related Questions