How to create friendly URL in php?

后端 未结 8 1843
一整个雨季
一整个雨季 2020-11-21 11:06

Normally, the practice or very old way of displaying some profile page is like this:

www.domain.com/profile.php?u=12345

where u=12345

8条回答
  •  感动是毒
    2020-11-21 11:39

    It's actually not PHP, it's apache using mod_rewrite. What happens is the person requests the link, www.example.com/profile/12345 and then apache chops it up using a rewrite rule making it look like this, www.example.com/profile.php?u=12345, to the server. You can find more here: Rewrite Guide

提交回复
热议问题