开发者

Apache mod rewrite .htaccess

开发者 https://www.devze.com 2023-04-01 03:43 出处:网络
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:

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

精彩评论

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

关注公众号