search

Home  >  Q&A  >  body text

php - tp5 how to implement a url like this

In tp5, the general URL is like this

/article/id/5.html
or
/article/5.html

How to implement the following format
/article_id_5.html
/article_5.html

If written directly in the routing, it will prompt that the module does not exist

ringa_leeringa_lee2831 days ago746

reply all(2)I'll reply

  • PHPz

    PHPz2017-05-16 13:19:01

    In the configuration file config.php, in the URL setting section, there is a pathinfo_depr parameter configuration. The default is "/". You can just change it to the "_" you need.

    reply
    0
  • 習慣沉默

    習慣沉默2017-05-16 13:19:01

    "URL_PATHINFO_DEPR"=>"-" Add this to the configuration item

    reply
    0
  • Cancelreply