How was a URL like http://stackoverflow.com/posts/1807421/edit created in PHP?

后端 未结 8 920
暖寄归人
暖寄归人 2021-01-23 06:10

When you edit a question on stackoverflow.com, you will be redirected to a URL like this:

https://stackoverflow.com/posts/1807421/edit

8条回答
  •  一个人的身影
    2021-01-23 06:56

    I am poor at this but i do know you can redirect urls using apache mod_rewrite and by touching config files. From what i remember htaccess can be used to redirect. Then internally when the user hits http://stackoverflow.com/posts/1807421/edit it can use your page http://stackoverflow.com/edit.php?p=1807421 instead or whatever you want.

提交回复
热议问题