dtvpl739577 2015-11-20 07:09
浏览 27
已采纳

而不是使用?id = 30

and thanks for taking a look to this weird and awkward post.

I have been working on a Cars website for a while (version: 1) wich is pretty basic, now im learning a little bit more about POO so i guess i will be updating it...

I have seen before on a Scripts website that they do this:

Example:

websiteurl.com/scripts/view/300 or websiteurl.com/scripts/view/1761/media/ or websiteurl.com/scripts/view/1761/comments

Im currently doing this:

mywebsite.com/viewCars.php?id=300 but i would like instead of doing that , doing this:

mywebsite.com/cars/view/300

Thanks, and i hope someone understand my question, forgive me for my bad spelling but english isn't my first language.

  • 写回答

3条回答 默认 最新

  • douchai7891 2015-11-20 07:23
    关注

    Assuming you are using apache, soemthiing like this should give you the format you mentioned

    in your .htaccess file
    ----------------------
    
    RewriteEngine On
    RewriteBase /
    RewriteRule ^cars/view/([0-9]+)$ viewCars.php?id=$1 [NC,L]
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向
  • ¥15 如何用python向钉钉机器人发送可以放大的图片?
  • ¥15 matlab(相关搜索:紧聚焦)
  • ¥15 基于51单片机的厨房煤气泄露检测报警系统设计
  • ¥15 Arduino无法同时连接多个hx711模块,如何解决?
  • ¥50 需求一个up主付费课程
  • ¥20 模型在y分布之外的数据上预测能力不好如何解决