Google 之后知道是用 rewrite 规则来写,但是试了几个网上提供的写法都没效果。 于是来求助万能的 V2EXer ,万分感谢🙏
|      1aprikyblue      2016-07-30 13:02:27 +08:00 via Android 首先你得让程序输出的 url 不带后缀。。。这不是 rewrite 管的。。 做完上边的然后才是 rewrite 的事 | 
|  |      2terax OP @aprikyblue 我在本机测试的时候用的是 Apache 作为服务器,就是可以直接不带后缀访问的。不太懂“程序输出的 url ”是什么意思哎? | 
|  |      3babytomas      2016-07-30 15:25:14 +08:00  1 让网站通过 /example 可以访问到索引目录下的 example.php ,例子: ``` rewrite ^/example$ /./example.php last; ``` | 
|      4yaodong      2016-07-30 15:35:32 +08:00 via iPhone 目测楼主在 apache 用的是古老的连 html response 里面的 url 都 rewrite 的 mod 。这个好多年没见过了。 | 
|  |      6chaegumi      2016-07-30 18:23:14 +08:00 #if (!-e $request_filename){ # rewrite (.*) /index.php last; #} try_files $uri $uri/ /index.php?$query_string; | 
|      715759943015      2016-07-31 02:05:43 +08:00 难道不是在说伪静态吗....把 php 后缀变成 html 后缀不是同理? | 
|  |      8qinxi      2016-07-31 10:44:52 +08:00 1 楼详细点就是  1,你的页面显示的 xxx.php 后面的.php 需要先去掉, 2,到服务端需要把 xxx 的 url rewrite 到 xxx.php |