+ -
当前位置:首页 → 问答吧 → 求个.htaccess的伪静态写法

求个.htaccess的伪静态写法

时间:2009-01-20

来源:互联网

test.vinwo.com
下面的列表页打开后是http://test.vinwo.com/3611717.shtm
是没有这个文件的.我写了个http://test.vinwo.com/new.php?id=3611717
打开是有内容的,现在是我想写个.htaccess
让打开
http://test.vinwo.com/3611717.shtm显示的是http://test.vinwo.com/new.php?id=3611717的内容
也就是说点击下方各列表都会显示内容

作者: 疯狂痴呆   发布时间: 2009-01-20

nginx的写法:rewrite test.vinwo.com/(\d+)\.shtm test.vinwo.com/new.php?id=$1 last
apache的写法:
RewriteEngine on
RewriteRule  test.vinwo.com/(\d+)\.shtm test.vinwo.com/new.php?id=$1 [L]


以上未经过测试,你自己试试吧

作者: xieaotian   发布时间: 2009-01-21

原帖由 xieaotian 于 2009-1-21 09:49 发表
nginx的写法:rewrite test.vinwo.com/(\d+)\.shtm test.vinwo.com/new.php?id=$1 last
apache的写法:
RewriteEngine on
RewriteRule  test.vinwo.com/(\d+)\.shtm test.vinwo.com/new.php?id=$1 [L]


以上未 ...
RewriteEngine on
RewriteRule  test.vinwo.com/(\d+)\.shtm test.vinwo.com/new.php?id=$1 [L]


不行,郁闷啊

作者: 疯狂痴呆   发布时间: 2009-01-21

作者: 疯狂小猫   发布时间: 2009-01-21

谢顶

作者: 疯狂痴呆   发布时间: 2009-01-22

?????????

作者: 疯狂痴呆   发布时间: 2009-01-28

不错学到不少,

作者: verywebsite   发布时间: 2009-05-04

RewriteRule  ^\/(\d+)\.shtm$ new.php?id=$1 [L]

应该是相对路径

作者: yafeikf   发布时间: 2009-05-07

热门下载

更多