-1

Its just a question out of curiosity.

I have seen a lot of websites that doesn't show the page types/extensions in the address bar.For example, the stackoverflow's Ask Question page has the address stackoverflow.com/questions/ask instead of something like stackoverflow.com/questions/ask.php.

Do they use something to hide that page extension?Or why I do not see the page extension?

I think its a nice think for page security.

feeela
  • 29,399
  • 7
  • 59
  • 71
Naveen
  • 7,944
  • 12
  • 78
  • 165
  • People use an HTaccess file to rewrite urls.. There is already a topic for this on stackoverflow: http://stackoverflow.com/questions/3912673/learning-htaccess – Naruto Jan 13 '14 at 13:51
  • possible duplicate of [How to remove file extension from website address?](http://stackoverflow.com/questions/6534904/how-to-remove-file-extension-from-website-address) – feeela Jan 13 '14 at 13:56
  • -1; you would have found the answer by using a search engine first; there are also multiple duplicates on SO… – feeela Jan 13 '14 at 13:56

4 Answers4

0

using .htaccess file, you can do that

something similar here Remove .php extension with .htaccess

Community
  • 1
  • 1
codepiper
  • 129
  • 10
0

A .htaccess (hypertext access) file is a directory-level configuration file supported by several web servers, that allows for decentralized management of web server configuration. They are placed inside the web tree, and are able to override a subset of the server's global configuration for the directory that they are in, and all sub-directories.

htaccess file

Rewrite Guides

More htaccess tips and tricks

Rewrite Url

Servers often use .htaccess to rewrite long, overly comprehensive URLs to shorter and more memorable ones.

Authorization, authentication A .htaccess file is often used to specify security restrictions for a directory, hence the filename "access". The .htaccess file is often accompanied by a .htpasswd file which stores valid usernames and their passwords

Given three links above these will explain you in better way.

Community
  • 1
  • 1
Kaushik
  • 2,072
  • 1
  • 23
  • 31
  • [links are fantastic, but they should never be the only piece of information in your answer](http://meta.stackexchange.com/questions/8231/are-answers-that-just-contain-links-elsewhere-really-good-answers) – feeela Jan 13 '14 at 13:58
  • @feeela I was doing that Just edited the final one. Sorry for the late . – Kaushik Jan 13 '14 at 14:04
0

All the .htaccess answers that you have seen apply to traditional PHP applications because they are all uploaded as normal files to the document root of a webserver. This means that each PHP file is "browsable" directly, assuming you haven't prevented this at your webserver configuration.

StackOverflow (which is a .NET application) and other modern applications use a URL mapping paradigm - not only does this help with "clean" URLs, but also because cool URIs don't change. It really doesn't have anything to do with security.

So it is most likely that each URL is mapped to a function, this function returns a response that is sent to the browser.

PHP frameworks offer the same - Laravel routing, symfony routing and zend framework routing are all examples of this mapping paradigm.

Burhan Khalid
  • 169,990
  • 18
  • 245
  • 284
-1

this is done by using the .htaccess file to configure the details of a website

example:

RewriteEngine on
Rewrite Base /
RewriteRule ([a-z]+)/?$ index.php?menu=$1 [NC,L]

this example rewrites a URL which looks like this www.mydomain.com/home into www.mydomain.com?index.php&menu=home

for more details please search stackoverflow / google

qsi
  • 683
  • 1
  • 7
  • 16