문제

In implementing clean URLs I wanted to map http://www.pikspeak.com/iframe/3/bird?autoplay=true to http://www.pikspeak.com/iframe.php?id=3&img=bird&autoplay=true using the following regex

RewriteRule ^/iframe/([^/\.]+)/([^/\.?]+)\\?([^/\.]+) /iframe.php?id=$1&img=$2&$3

But the problem is that the last character of the value of img get parameter (in this 'bird') is deleted, i.e. 'bir'. Can you please help out with this issue.

Other than that I am also not able to to get the 'autoplay' parameter in php.

Thanks in advance

도움이 되었습니까?

해결책

  1. I think by \\? you actually mean \?.
  2. No need to escape \. in character classes.
  3. Instead of trying to match the query string, use the [QSA] modifier.
RewriteRule ^/iframe/([^/.]+)/([^/.]+)$ /iframe.php?id=$1&img=$2 [QSA]
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top