dongyun3897 2011-08-29 18:03
浏览 11
已采纳

基于url(又名DIGG)在数据库中提取数据

I'm having a hard time even figuring out how to write a Google search to figure this out.

If you click on a story on Digg it puts it all in the URL like digg.com/news/science/why_the_world_is_tilted, instead of digg.com/reader.php?r=news&s=science&t=why_the_world_is_tilted

I'm pretty sure they don't have several million subfolders, and I recall reading something 4 years ago that explained how it works, but I don't remember enough to look it up again.

  • 写回答

4条回答 默认 最新

  • drn9573 2011-08-29 18:19
    关注

    If your server is running Apache and mod_rewrite is installed you can create a file called .htaccess containing this:

    <IfModule mod_rewrite.c>
      RewriteEngine on
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
    </IfModule>
    

    This will send the path to a request index.php in the var $_GET['q']. It wont send the path to index.php if the path is to an existing file or directory.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

悬赏问题

  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器