Generate URL Alias?? in PHP

后端 未结 4 610
刺人心
刺人心 2021-01-22 04:55

I just saw this somewhere, and I\'m interested on it, and can\'t seemed to find it anywhere or I just used the wrong words to search for.

Well I saw this link,



        
4条回答
  •  一整个雨季
    2021-01-22 05:36

    These are done with RewriteRule, a simple Google search willgive you mroe details.

    In short, the URL will be broken down sorta like this: (Line 1, URL part, Line 2, PHP relative.

    http://splur.gy
    http://splur.gy/index.php

    r
    $_GET['var_1']

    QqVYf
    $_GET['var_2']

    r
    $_GET['var_3']

    2tgNklHgmVK
    $_GET['var_4']

    The RewriteMod will take the URL as setup in the above format, and pass the varialbes to a script. It is another way of posting variables in the URL.

    As you see above: stackoverflow.com/posts/15182831, does not actually have a file named posts/15182831, it is simple used as a variable, passed to a script which queries that database, and spits out results based on what the script says.

提交回复
热议问题