开发者

Problem with .htaccess RewriteRules

开发者 https://www.devze.com 2023-03-31 04:59 出处:网络
I have this .htaccess RewriteRules, that doesn\'t work. RewriteRule ^(.+)\\/(.+)\\/$ /index.php?pg=$1&act=$2

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

精彩评论

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