Problem with .htaccess RewriteRules

I have this .htaccess RewriteRules that does not work.

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

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

Having done some tests, I found that pgvar is also not passed .

I have one more such line, RewriteRule ^(.+)\/$ /index.php?pg=$1and it works! So, I do not know why the first does not work!

+5
source share
1 answer

If you do not need to use any characters other than az and 0-9, I recommend that you use this:

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

It should work.

+3
source

All Articles