开发者

Problem with .htaccess RewriteRules

I have this .htaccess RewriteRules, that doesn't work.

RewriteRule ^(.+)\/(.+)\/$ /index.php?pg=$1&act=$2

What this code should do, is transofrm /somthing/other/ into /index.php?pg=somthing&act=other.

开发者_如何学Go

Making some test, I discovered that also the pg var is not passed.

I have another line like this, RewriteRule ^(.+)\/$ /index.php?pg=$1 an it work! So, I don't know why the first one didn't work!!


If you don't need to use any other characters than a-z and 0-9 I recommend you to use this:

RewriteRule ^([a-z0-9-]+)/([a-z0-9-]+)$ /index.php?pg=$1&act=$2

It should work.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜