php - Changing Request URL by the Server -


a sample url of question posted on stackoverflow given below.

http://stackoverflow.com/questions/11227809/why-is-processing-a-sorted-array-faster-than-an-unsorted-array 

the above url complete url question on stackoverflow, can load same page using url below (note description @ end deleted):

http://stackoverflow.com/questions/11227809 

try loading above url , after page loads, @ address bar, url mentioned @ first.

i think happens when requesting 2nd url this:

  1. stackoverflow searches , finds question id 11227809.

  2. then redirects user original url.

are assumptions correct? how can php? (just background of how-to, , know stackoverflow written in asp.net)

you can store slugs contents ids. if @ $_server you'll find requested url. if not contain slug can in db , redirect it.


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -