php - .htaccess alternative to B flag? (escape backreferences) -


i have .htaccess set following:

rewritecond %{request_filename} !-d rewritecond %{request_filename} !-f rewriterule ^([a-za-z0-9_-]+)/?$ profile.php?aid=$1 [l,qsa] 

this gets users profile fine, if username example "apple & pears" 404 page not found. believe down encoding issue ampersand. i've researched , found b flag solve problem, host's apache version below 2.2.7 when introduced.

is there method replicate this?

have 2 separate rules this:

rewritecond %{request_filename} !-d rewritecond %{request_filename} !-f rewriterule ^([^&]+)&([^/]+)/?$ /index.php?aid=$1\%26$2 [l,qsa]  rewritecond %{request_filename} !-d rewritecond %{request_filename} !-f rewriterule ^([^/]+)/?$ /index.php?aid=$1 [l,qsa] 

Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -