- I think by
\\?
you actually mean\?
. - No need to escape
\.
in character classes. - Instead of trying to match the query string, use the
[QSA]
modifier.
RewriteRule ^/iframe/([^/.]+)/([^/.]+)$ /iframe.php?id=$1&img=$2 [QSA]
题
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
解决方案
\\?
you actually mean \?
.\.
in character classes.[QSA]
modifier.RewriteRule ^/iframe/([^/.]+)/([^/.]+)$ /iframe.php?id=$1&img=$2 [QSA]