开发者

Apache mod rewrite .htaccess

I can get basic tests to work with mod rewrite ie:

RewriteEngine on
RewriteRule ^index.php$ test.php

But what I'm really trying to accomplish is changing my dynamic url ie:

detail.php?id=1

to something like

detail-id-18.htm

Now this is what I have in place (that I thought would have worked) but of course nothing is happe开发者_如何学Pythonning:

RewriteEngine on
RewriteRule detail-id-(.*)\.htm$ detail.php?id=$1   


Try this

RewriteEngine On
RewriteBase /
RewriteRule ^detail-id-([0-9]+)\.htm$ detail.php?id=$1
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜