Cascade rewriting with special characters

Posted by Korjavin Ivan on Server Fault See other posts from Server Fault or by Korjavin Ivan
Published on 2013-10-27T08:05:54Z Indexed on 2013/10/27 9:57 UTC
Read the original article Hit count: 344

Filed under:
|
|
|

I have this .htaccess

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php

All queries send to index.php.

In my site, I have this link: http://site/search/?v[1]=myid it work nice, I think index.php handle it.

But now I want to more readable name for this link, something like http://site.si/byid_$myid.html

I tried

#    RewriteRule ^byid_(.*).html$ search/?v\%5B1\%5D=$1 [NC,PS,NE] #escape and urlencode
#    RewriteRule ^byid_(.*).html$ search/?v%5B1%5D=$1 [NC,PS,NE] #urlencode
#    RewriteRule ^byid_(.*).html$ search/?v[1]=$1 [NC,PS,NE]    #raw

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php

Each of this lines kills rewriting, all requests return 500 error.

Where is my fault?

© Server Fault or respective owner

Related posts about apache2

Related posts about .htaccess