dongle0396 2016-09-12 19:22
浏览 35

PHP如何创建新的html页面? [关闭]

As many of you know when someone creates a StackOverflow question a new page is generated and it is visible in the various search engines as well. I was wondering how PHP code created these pages. It turns out that most websites like this have one page, something like profile.php and it loads the data from a MySQL database. My question is as follows: If there is only one physical file how can the URL change and how does google list all of the pages/profiles/question from sites like StackOverflow or Facebook if there is only one actual page?

  • 写回答

5条回答 默认 最新

  • dongrang2140 2016-09-12 19:27
    关注

    You tell search engines 'Google, Bing, ..etc' for example to see your website by giving them sitemap.xml listing your pages, allow their web-bots (spider) access too the site and crawl the data and links, you may have one page like posts.php and it is different with parameters posts.php?id=123 or posts.php?name=mypost

    Edited: If you want use one file posts.php and make site http://domain.com/posts/posttitle you need to apply Front Controller Pattern site point link and this implies setting you server Apache/Nginx to redirect the requests to one file (URL rewrite) and this file contain the logic for handle the request or use MVC framework

    评论

报告相同问题?

悬赏问题

  • ¥15 一道python难题2
  • ¥15 一道python难题
  • ¥15 用matlab 设计一个不动点迭代法求解非线性方程组的代码
  • ¥15 牛顿斯科特系数表表示
  • ¥15 arduino 步进电机
  • ¥20 程序进入HardFault_Handler
  • ¥15 oracle集群安装出bug
  • ¥15 关于#python#的问题:自动化测试
  • ¥20 问题请教!vue项目关于Nginx配置nonce安全策略的问题
  • ¥15 教务系统账号被盗号如何追溯设备