php - How to match spaces and ascii characters in .htaccess file -
i'm trying match special characters in .htaccess
file id value can return page matching correct id value.
in mysql field text is: thelma & louise
before rewrite rule page address looked property data populating page www.site.com/movie.php?id=thelma+%26+louise
my rewriterule ^movie/([a-za-z0-9_-\s]+)/?$ /movie.php?id=$1
the url comes out page not found error
www.site.com/movie/thelma+%26+louise
how can match ascii characters page displayed.
thanks help!
the uri gets decoded before gets run through of rewrite rules, need match against space , ampersand
&
. pattern, ([a-za-z0-9_-\s]+)
needs account symbols:
rewriterule ^movie/([a-za-z0-9_&+-\s]+)/?$ /movie.php?id=$1 [l,b]
additionally, need use b
flag grouped match $1
gets propery encoded in query string.
Comments
Post a Comment