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
.
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.
精彩评论