简体   繁体   中英

Is “example.com/index.php/page/about/” good practice?

Normally, one would find that the URL is "example.com/index.php?page=about" or better, "example.com/page/about/". But in this case it is "example.com/index.php/page/about/". Note the index.php in the middle.

Questions:

  1. Is this normal practice?
  2. If it is normal, how did the author of the site structure the pages in this way?
  3. If he/she could have rewritten the URL, why did he/she not bother to remove the ugly looking "index.php" from the URL?

Thank you all for your patience. I'm relatively new to web development in general.

I am not really sure what you are asking but: "example.com/index.php?page=about" is pretty normal "page" being a get variable available to index.php. http://php.net/manual/en/reserved.variables.get.php You can remove the variables from user view or just use POST rather than GET.

You could if you really wanted to (but you shouldn't) parse out what you need from $_SERVER['REQUEST_URI'] allowing you to do all manner of trickery with your precise url allowing for example.com/index.php/page/about or example.com/page/about leading back to index.php.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM